Put it in another timer using timer.Create or in a think hook
So i've been trying to make a godmode for darkrp but there is a problem I have ran into
This will only type "/buyhealth" ONCE how do I make it continuously type "/buyhealth"Code:if ( LocalPlayer():Alive() && LocalPlayer():Health() < 75 ) then RunConsoleCommand("say", "/buyhealth") end
(Obv want to put in my own script will release later)
Thanks ~ Keepo123
Last edited by Hunter; 01-17-2016 at 12:49 PM.
Put it in another timer using timer.Create or in a think hook
Thanks! I will try and post the results.
- - - Updated - - -
AyeeCode:function DarkRPGodMode() if ( LocalPlayer():Alive() && LocalPlayer():Health() < 75 ) then RunConsoleCommand("say", "/buyhealth") end end timer.Create( "TopKek", 0.2, 5, DarkRPGodMode )
Edit: Think I misunderstod what you ment lmao, can you show me an example with the timer?
Last edited by Keepo123; 11-12-2015 at 04:56 PM.
buckballs (02-08-2016)
the third argument in timer.Create is the amount of times you wanna do the shit in the timer
https://wiki.garrysmod.com/page/timer/Create
Well, the best way to achieve this is by calling it via the createmove hook
Here is an example of how you could do this
Code:hook.Add("CreateMove", "AutoHealthStuffs", function() if(LocalPlayer():Health() > 0 && LocalPlayer():Health() < LocalPlayer():GetMaxHealth()) then RunConsoleCommand("say", "/buyhealth"); end end)