Hello, I have been trying to figure out how to make it give 1 point every second that a player is walking. When I click "play" and walk, it gives too many points. I tried putting "wait(1)" in various locations, but it ends up just delaying the amount of points being given.
amount = 1
points = "Steps"
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
c:WaitForChild("Humanoid").Running:connect(function(speed)
if speed > 0
then p.leaderstats[points].Value = p.leaderstats[points].Value + amount
end
end)
end)
end)
I also have another script that goes with this one to set up the scoreboard here:
game.Players.PlayerAdded:connect(function(plr)
local stats = Instance.new("BoolValue",plr)
stats.Name = "leaderstats"
local steps = Instance.new("IntValue",stats)
steps.Name = "Steps"
steps.Value = 0
end)

3 comments
Also, I think the problem has to do with c:WaitForChild("Humanoid").Running:connect(function(speed)
is the game FE? where are the scripts located and what type of scripts are thye
Try using a loop and check every second if they are moving.