Can someone guide me on how to make it so the CP’s run faster when they take their arrest stick out?
if ply:GetActiveWeapon():GetClass() == “arreststickfoldername” then
– you get the picture
no i don’t get the picture, can you explain it a little better please?
So basically, since i’m a nice guy.
timer.Create(“checkarrestbaton”, 0.1, 0, function()–Made a timer to check every 0.1 seconds
for k,v in pairs(player.GetAll()) do – take all the players
if v:Alive() then – are we alive if yes continue
if (v:GetActiveWeapon():GetClass() == “arrest_stick” and v:Team() == TEAM_POLICE) then – if our wep is the ArrestStick and we are cp continue
v:SetRunSpeed(500) – change to w/e runspeed
else --if we arnt all that stuff^
v:SetRunSpeed(200) – change run speed to this
end – end the if
end – so on
I think it’d be better if the SetRunSpeed() lines were handled in the SWEP’s deploy and holster functions, and perhaps in OnRemove and OwnerChanged as well.
That could be a second option, I suppose.
But by the contents of his request he said specifically the CP and from the looks of your code you only included who has the baton.