I put a script in server script service and put this following:
01 | game.Players.PlayerAdded:Connect( function (plr) |
02 | plr.CharacterAdded:connect( function (c) |
03 | c:WaitForChild( "Humanoid" ).Running:connect( function (speed) |
04 | if speed > = 10 then |
05 | repeat |
06 | print ( "Working?" ) |
07 | plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value - 1 |
08 | until |
09 | if speed < 10 then |
10 | plr.leaderstats.Coins.Value = plr.leaderstats.Coins.Value + 1 |
11 | end |
12 | end |
13 | end |
14 | end ) |
Your problem is on line 2 where you said that the humanoid would be inside of Server Script service.