I am trying to make my script repeat so I am using While true do however whenever I use it it does Game script timeout. I think I need wait somewhere but I've put it everywhere I can think of. Here's the code:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(char)
local humanoid = char:WaitForChild("Humanoid")
while true do
if player.leaderstats.speed.Value <= 16 then
humanoid.WalkSpeed = 16
else
humanoid.WalkSpeed = 0.1 * player.leaderstats.speed.Value
wait(1)
end
end
end)
end)

2 comments
try replacing true with wait()
I have no idea how that did it but thanks!