So I made this one ice shard tool that when you throw on the ground you’re gonna freeze and every humanoid in a 10 studs radius for 10 seconds. If its a player then it will disable the runScript and toolScript in him so he can’t run (changing the speed from 0 back to 25) or throw and attack (duh he’s frozen).
Problem is it don’t work. The local scripts keep running even tho they’re disabled so I can run and use tools.
Idk I tried changing from enabled to disabled : didn’t work. Every other topics were people having problem with Enabled or Disabled or other parts of their code.
I’ll only put a part of my code, if you want more reply and tell me.
for i, v in pairs(players) do -- Go through the table
v.Humanoid.WalkSpeed = 0 -- Put its child walk speed to 0
v.Humanoid.JumpPower = 0 -- Put is childs jump power to 0
if game.Players:FindFirstChild(v.Name) then -- Disable the player from running and using tools
game.Players:FindFirstChild(v.Name).PlayerGui.ScreenGui.RunScript.Disabled = true
game.Players:FindFirstChild(v.Name).PlayerGui.ScreenGui.ToolScript.Disabled = true
end
end
sound:Play() -- Play the freezing sound
wait(10) -- Wait ten seconds
for i, v in pairs(players) do -- Go through the table again
v.Humanoid.WalkSpeed = 16 -- Put its child walk speed back to 16
v.Humanoid.JumpPower = 45 -- Put is childs jump power back to 45
if game.Players:FindFirstChild(v.Name) then -- Enable the player from running and using tools
game.Players:FindFirstChild(v.Name).PlayerGui.ScreenGui.RunScript.Disabled = false
game.Players:FindFirstChild(v.Name).PlayerGui.ScreenGui.ToolScript.Disabled = false
end
end
Also here is a video so you understand more :
Plz help.