i don't have any code because i don't know what to put in it and please include where i put the script in it Thanks :)
First, we need to detect if the player is running or not.
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) c:WaitForChild("Humanoid").Running:connect(function(speed) if speed > 8 then print(speed) end) end) end)
That script should detect how fast the player is going, usually when over 8 they are running, so you can raise it if needed
Now the removing coins.
local leaderstats = p:WaitForChild("leaderstats").Coins leaderstats.Value = leaderstats.Value - 1
To put them together do:
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) c:WaitForChild("Humanoid").Running:connect(function(speed) if speed > 8 then repeat print(speed) local leaderstats = p:WaitForChild("leaderstats").Coins leaderstats.Value = leaderstats.Value - 1 until speed < 8 then wait() end end) end) end)
make sure the last script is in server script storage
Closed as Not Constructive by hiimgoodpack and Torren_Mr
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?