So I was working on a script and I got it to work. It's a script that gives the player +10 Stumble Points upon touching the parent (a brick). It was working, I changed nothing with the script and now it doesn't work correctly. It still gives points, but instead of on touching the brick, it just gives the points on a loop. Any help is great! Heres the script:
game.Players.PlayerAdded:connect(function(plr)
local folder = Instance.new("Folder", plr)
folder.Name = "leaderstats"
local gems = Instance.new("IntValue", folder)
gems.Name = "Gems"
local StumblePoints = Instance.new("IntValue", folder)
StumblePoints.Name = "StumblePoints"
end)
while wait(5) do
for _,player in pairs(game.Players:GetPlayers()) do
if player:FindFirstChild("leaderstats") then
player.leaderstats.StumblePoints.Value = player.leaderstats.StumblePoints.Value + 10
end
end
end
Nothing was changed in the Output spot when i worked on other things. Nothing is said about the script in there too.

3 comments
use a touched event
Ok, will do.
Do you have it in a script? If so you might want to change it to a local script