game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function(character)
for i, v in pairs(game.Players:GetChildren()) do
if v.Perks.Runner.Value == false then
character.Humanoid.WalkSpeed += 0
elseif v.Perks.Runner.Value == true then
character.Humanoid.WalkSpeed += 30
end
end
end)
end)
1 Like
you don’t need to check if it’s false if it’s not going to do anything
you also don’t need to iterate like this. if you kept this, it would make it so every time a player spawns, the player that spawned will get +30 walk speed for every player in the game (e.g. if 5 players returned true then the player would get +150 walk speed)
if you want this to happen upon the player spawning you could just do
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
if player.Perks.Runner.Value == true then
character.Humanoid.WalkSpeed += 30
end
end)
end)
you could also probably use attributes for this if you wanted to
2 Likes
Unsure of what you’re trying to do, but this script is your script but formatted:
game.Players.PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
for _, player in pairs(game.Players:GetChildren()) do
character.Humanoid.WalkSpeed += player.Perks.Running.Value and 30 or 0
end
end)
end)
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.