• Problem with "Wounded" Script
    6 replies, posted
So, Im making a wounded system and right now, when you respawn, your weapons become invisible Code- Client- [CODE] if client:GetWalkSpeed() == 0 then draw.SimpleText("Wounded", "Name2",ScrW()/4, ScrH() / 2, Color(255, 255, 255, 155), 0, 0) end[/CODE] Serverside- [CODE]function GM:PlayerSpawn(ply) ply:SetRunSpeed(200) ply:SetWalkSpeed(150) ply:Give("cw_extrema_ratio_official") ply:Give("khr_p345") ply:Give("khr_sks") ply:Give("cw_frag_grenade") ply:Give("cw_flash_grenade") ply:Give("cw_smoke_grenade") ply:SetupHands() ply:SetModel("models/player/urban.mdl") ply:SetNWInt("woundedcheck", 0) end function GM:PlayerHurt( victim, attacker ) if victim:Health() <= 5 then victim:SetNWInt("woundedcheck", 1) victim:SetRunSpeed(0) victim:SetWalkSpeed(0) end end function woundCheck (ply) local ply = Entity( 1 ) if ply:Health() > 5 then ply:SetRunSpeed(200) ply:SetWalkSpeed(150) end end hook.Add("Think", "wounds", woundCheck)[/CODE]
do your weapons become invisible on your viewmodel or worldmodel?
viewmodel, it still shows the worldmodel also, is it possible to force crouching?
[QUOTE=PhantomServer;51280124]is it possible to force crouching?[/QUOTE] [url]http://wiki.garrysmod.com/page/CUserCmd/SetButtons[/url]
fixed, just made the walk speed 10, which is pretty much the same as 0
Could anyone go into depth with the whole crouching thing?
[QUOTE=PhantomServer;51282362]Could anyone go into depth with the whole crouching thing?[/QUOTE] [code]hook.Add("CreateMove", "", function(cmd) cmd:SetButtons(cmd:GetButtons() + IN_DUCK); end)[/code] output: forces you to crouch
Sorry, you need to Log In to post a reply to this thread.