• Slow at low HP/// No sound script
    10 replies, posted
Hi everyone its me again i want to know how can i make a lua script how make me slower when im under 25 HP just change the walkspeed for make it slow and how can i make a script for when i die the sound go off if you are dead you cant ear you know XD thx for help Sorry for bad english
I think you need to look into learning some Lua... [url]http://wiki.garrysmod.com/?title=Lua_Tutorial_Series[/url] [editline]8th December 2010[/editline] However, look into the EntityTakeDamage hook, and then do something with ply:SetSpeed. What type of sound do you want, microphone? All sound?
all sound like when i die that wait 1 sec and after that all sound are disabled but when you respawn all sound are enabled :P ply:SetWalkSpeed(175 ) ply:SetRunSpeed( 250 ) what line need i tu put over this if i want this when im under 25 HP [editline]8th December 2010[/editline] is that suposed to work if (self:Health() <= 25 ) ply:SetWalkSpeed(175 ) ply:SetRunSpeed( 250 ) then() end
[lua] if LocalPlayer():Health() <= 25 then ply:SetWalkSpeed( 175 ) ply:SetRunSpeed( 250 ) end [/lua] right?
[QUOTE=Persious;26584046][lua] if LocalPlayer():Health() <= 25 then ply:SetWalkSpeed( 175 ) ply:SetRunSpeed( 250 ) end [/lua] right?[/QUOTE] [lua] hook.Add( "Think", "gay", function() for k, v in pairs( player.GetAll() ) do if( ValidEntity( v ) ) then if( v:Health() <= 25 ) then v:SetRunSpeed( 100 ); end end end end )[/lua] Something like that
cool ill try it
[lua] function LowHPSpeed() if 25 > ply:Health() then ply:SetWalkSpeed(30) ply:SetRunSpeed(45) ply:PrintChat("You have been hurt! Get to a medic!") end end hook.Add("ScalePlayerDamage","SetSpeed",LowHPSpeed) [/lua] Unsure if this will work because of the arguments I used, but its probable it will work.
[QUOTE=pac0master;26578328]all sound like when i die that wait 1 sec and after that all sound are disabled but when you respawn all sound are enabled :P ply:SetWalkSpeed(175 ) ply:SetRunSpeed( 250 ) what line need i tu put over this if i want this when im under 25 HP [editline]8th December 2010[/editline] is that suposed to work if (self:Health() <= 25 ) ply:SetWalkSpeed(175 ) ply:SetRunSpeed( 250 ) then() end[/QUOTE] then isn't a function.
[QUOTE=zzaacckk;26683617][lua] function LowHPSpeed() if 25 > ply:Health() then ply:SetWalkSpeed(30) ply:SetRunSpeed(45) ply:PrintChat("You have been hurt! Get to a medic!") end end hook.Add("ScalePlayerDamage","SetSpeed",LowHPSpeed) [/lua] Unsure if this will work because of the arguments I used, but its probable it will work.[/QUOTE] Also, ply will be nil :3
Sorry, you need to Log In to post a reply to this thread.