Ad
Log in to vote
0

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

Asked by 17 days 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 16 days ago
Edited 16 days 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 — 16d
0
I'm trying to make a walkspeed function using the events PlayerAdded and CharacterAdded JerkDerekThe14alt 11 — 16d
0
I fixed a small typo, try it now. Scryptio 64 — 16d
Ad

Answer this question