New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why won't my script set my WalkSpeed and JumpPower to 0?

Asked by
Txeer 4
3 months ago
game.Players.PlayerAdded:Connect(function(plr)



local timesTouched = game.Workspace:WaitForChild("Teleportd")


repeat wait() until timesTouched.Value == 2


local hum = plr.Character:FindFirstChild("Humanoid")





if timesTouched.Value == 2 then
game.Workspace.The_sign.Position = game.Workspace.Copysignpos.Position
    hum.WalkSpeed = 0
    hum.JumpPower = 0
    for i = 0, 1, 0.1 do
        game.Workspace.SpawnLocation.Transparency = i
        wait(0.1)
    end
    game.Workspace.SpawnLocation.CanCollide = false
    wait(3)
    game.Workspace.The_sign.Position = Vector3.new(-100,400,-500)
    hum.WalkSpeed = 24
    hum.JumpPower = 50
end

end)

I cannot seem to find anything wrong with this script. It will not set the character's WalkSpeed and JumpPower to 0.

2 answers

Log in to vote
0
Answered by
OnaKat 444 Moderation Voter
3 months ago

try add CharacterAdded

game.Players.PlayerAdded:Connect(function(plr)
    plr.CharacterAdded:Connect(function(char)
        --script
    end)
end)
0
It still didn't work Txeer 4 — 3mo
0
@Txeer maybe timesTouched.Value ~= 2 OnaKat 444 — 3mo
0
use server script to change timesTouched.Value not local script and don't change it by yourself in explorer OnaKat 444 — 3mo
0
It is a server script Txeer 4 — 3mo
0
There is another server script that changes the value of timesTouched Txeer 4 — 3mo
Ad
Log in to vote
0
Answered by 3 months ago
game:GetService("Players").LocalPlayer.Character.Humanoid.WalkSpeed = 0

Answer this question