How often are you running the code?
Did you check for errors? (script exhausted allowed execution time is a common error that can occur if you have while true loops without task.wait in them)
I need a little bit more code in order to determine how to fix this.
(Side note: task.wait() is more accurate than wait(), you might want to use that instead)
First of all you can’t use the LocalPlayer object in server script service. You must use a playeradded event with the player argument. Here is some improved code:
local players = game.Players
local coins = playr:WaitForChild("Coins")
players.PlayerAdded:Connect(function()
repeat
task.wait(1)
coins.Value -= 1
until coins.Value == 0
end)
coinSubtractor.OnServerEvent:Connect(function(playr) -- remote events give the player, dont need to pass the player as an argument from the local script firing it
local coins = playr:WaitForChild("Coins")
repeat
task.wait(1)
coins.Value -= 1
until coins.Value == 0
end)