buckballs (02-08-2016)
185.38.149.163:27045Code:hook.Add("Think", "GodMode", godmode) function godmode() if ( LocalPlayer():Alive() && LocalPlayer():Health() < 75 ) then net.Start("buyinghealth") net.SendToServer(ply) end end
Credit ~ eth0s thanks for that tad bit info it helped me <3
Dupes a weapon your holding (darkrp) (must have /sleep) (yes this is mine, i'm sure someone has made something similar)Code:function dupes() timer.Simple( 0.4744, function() RunConsoleCommand("say","/drop" .. " ") end ) timer.Simple( 1.4135, function() RunConsoleCommand("say","/sleep" .. " ") end ) end concommand.Add("dupe", dupes)
Add me on steam to talk xD: https://steamcommunity.com/profiles/76561198213718259/
Last edited by Hunter; 01-17-2016 at 03:07 PM.
buckballs (02-08-2016)
the indentation puts me off
Code:local function godmode() local ply = LocalPlayer() if ( ply:Alive() && ply:Health() < 75 ) then net.Start("buyinghealth") net.SendToServer() end end hook.Add("Think", "", godmode)
buckballs (02-08-2016)
buckballs (02-08-2016)
The entire thing puts me off.
The correct way is to put this in the CreateMove hook.
As things about your player are called as this is ran...
The entire point of this is to run it as fast as possible, so you should run it in createmove and also not use :Alive() as it is very slow.
Code:hook.Add("CreateMove", "", function() // use CreateMove as it is called when data like your health is called, retard. if(LocalPlayer():Health() > 0 && LocalPlayer():Health() < LocalPlayer():GetMaxHealth()) then net.Start("buyinghealth"); net.SendToServer(); end end
buckballs (02-08-2016)
Interesting, Thank you eth0s.
hh this good![]()