Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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.

3 comments

0

not working :l

0

I'm trying to make a walkspeed function using the events PlayerAdded and CharacterAdded

0

I fixed a small typo, try it now.

This discussion is preserved as it was. New answers, comments, and votes are closed.