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

I'm trying to make this walkspeed script function properly can anyone fix it?

Asked by 2 years ago

Can anyone help me with what I'm doing wrong?

local speed = 50
game.Players.PlayedAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        if character:FindFirstChild("Humanoid") then
            character.WalkSpeed = speed
            else
        end
    end)
end)

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

WalkSpeed is a property of Humanoid, not Character. Try this:

local speed = 50
game.Players.PlayerAdded:Connect(function(player)
    player.CharacterAdded:Connect(function(character)
        if character:FindFirstChild("Humanoid") then
            character.Humanoid.WalkSpeed = speed
            else
        end
    end)
end)

Edit: There was a typo in your original code, try it now.

0
not working :l JerkDerekThe14alt 11 — 2y
0
I'm trying to make a walkspeed function using the events PlayerAdded and CharacterAdded JerkDerekThe14alt 11 — 2y
0
I fixed a small typo, try it now. Scryptio 64 — 2y
Ad

Answer this question