SolvedHow to loop for GLua?

Posts 1–15 of 29 · Page 1 of 2
How to loop for GLua?
Hello, I am fairly new to lua only started for about a week now.
I've been trying to make a exploit but I need to make it loop so It can be AFKABLE

Code:
function kappa()
timer.Simple( 0.4744, function() RunConsoleCommand("say","/drop" .. " ")  end )
timer.Simple( 1.4135, function() RunConsoleCommand("say","/sleep" .. " ")  end )
end
RunConsoleCommand("use", "WEAPON_IDl")
concommand.Add ("dupe", kappa )
I want make this have a constant loop and also have it change weapons if you understand.

Thanks, Keepo
function die()
print("kill")
end

timer.Create("blackpileofsticks" /*name*/, 1 /*time in seconds*/, 0 /*times repeated, 0 for infinite*/, die /*function*/)
timer.Remove("blackpileofsticks" /*name to remove*/)
for i = 1, math.huge do
cam.End3D()
end

(Private Don't Leak)
Quote Originally Posted by Keepo123 View Post
Hello, I am fairly new to lua only started for about a week now.
I've been trying to make a exploit but I need to make it loop so It can be AFKABLE

Code:
function kappa()
timer.Simple( 0.4744, function() RunConsoleCommand("say","/drop" .. " ")  end )
timer.Simple( 1.4135, function() RunConsoleCommand("say","/sleep" .. " ")  end )
end
RunConsoleCommand("use", "WEAPON_IDl")
concommand.Add ("dupe", kappa )
I want make this have a constant loop and also have it change weapons if you understand.

Thanks, Keepo
http://lmgtfy.com/?q=how+to+make+a+loop+in+lua
Its as easy as that learn google ya scrub
Thanks for letting me know how to use google!!!!11111!111!

- - - Updated - - -

function kappa()

RunConsoleCommand("use", "m9k_ak47")
timer.Simple( 0.4744, function() RunConsoleCommand("say","/drop" .. " ") end )
timer.Simple( 1.4135, function() RunConsoleCommand("say","/sleep" .. " ") end )
end

timer.Create( "Drops weapons", 5, 10, function() kappa("mhm") end )

concommand.Add ("dupe", kappa )


if anyone was wondering, I found out how to do it.
dont use timer.Simple use
Code:
 while true do
 RunConsoleCommand("use", "m9k_ak47")
 sleep(0.4744)
 RunConsoleCommand("say","/drop" .. " ")
 sleep(1.4135)
 RunConsoleCommand("say","/sleep" .. " ")
end
free of charge
Quote Originally Posted by Gorzoid View Post
dont use timer.Simple use
Code:
 while true do
 RunConsoleCommand("use", "m9k_ak47")
 sleep(0.4744)
 RunConsoleCommand("say","/drop" .. " ")
 sleep(1.4135)
 RunConsoleCommand("say","/sleep" .. " ")
end
free of charge
while true loops crash you and you can't do sleep in gmod
Quote Originally Posted by eth0s View Post
while true loops crash you and you can't do sleep in gmod
While true loops do crash gmod I believe but you can indeed sleep in gmod on 50% of servers
Quote Originally Posted by Keepo123 View Post
While true loops do crash gmod I believe but you can indeed sleep in gmod on 50% of servers
what

are you talking about /sleep on darkrp?
Quote Originally Posted by cdrizzle View Post
what

are you talking about /sleep on darkrp?
Yup
/2short

- - - Updated - - -

With the timing like this, It will dupe the weapon that you have equiped
Quote Originally Posted by Keepo123 View Post
While true loops do crash gmod I believe but you can indeed sleep in gmod on 50% of servers
im saying there is no sleep function
Quote Originally Posted by eth0s View Post
im saying there is no sleep function
Just do /sleep in darkrp????
go into a darkrp and type /sleep in chat you'll see.
Quote Originally Posted by eth0s View Post
no sleep function in glua
function Sleep()
RunConsoleCommand("say", "I'm gonna sleep now.")
RunConsoleCommand("kill")
end
In multi-threaded applications the sleep function will just suspend to thread to the given interval, so if there was a sleep function in Lua, it wouldn't do anything but freeze up.
Posts 1–15 of 29 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us