Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

WalkSpeed scipt gone wrong?

Asked by 4 years ago

idk what am I doing wrong, but anyways i want the script to change your walkspeed

script.Parent.ClickDetector.MouseClick:Connect(function(lol)
    local humanoid = lol.Parent:FindFirstChild("Humanoid")
    if humanoid ~= nil then
    humanoid.WalkSpeed = 0
    end
end)
0
more context? theking48989987 2147 — 4y
0
When a part is clicked your WalkSpeed is set to 0 Vibesgus 35 — 4y

1 answer

Log in to vote
0
Answered by
Prestory 1395 Moderation Voter
4 years ago
Edited 4 years ago

To check if the player has a humanoid you need to use an if statement correctly like i have done below

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    local Character = workspace:WaitForChild(player.Name)
    if Character:FindFirstChild('Humanoid') then
    Character.Humanoid.WalkSpeed = 0
    end
end)
0
didnt work Vibesgus 35 — 4y
0
oh wait let me edit one second Prestory 1395 — 4y
0
Try now i forgot this was using a click detector mb Prestory 1395 — 4y
Ad

Answer this question