So I am making a script that gives 10 KOs every 60 seconds.
The wait(1)
is a placeholder.
Can someone help?
Script:
local player = game.Players.LocalPlayer
wait(1)
player.leaderstats.KOs.Value = player.leaderstats.KOs.Value + 10 * (player.leaderstats.ReKOs.Value + 1)
Edit: There is a line down before the wait(1) and player.leaderstats.
You cannot use LocalPlayer on the server. You could use a remote event for example Server Script:
RemoteEvent.OnServerEvent:Connect(function(player)
end)
You do not need to use game.Players to start you would do "player.Character" for example
To fire this Remote you would use:
RemoteEvent:FireServer()
On the client
But in your case you would do this
1 | local WaitTime = 1 |
2 | game.Players.PlayerAdded:connect( function (player) |
3 | while true do |
4 | wait(WaitTime) |
5 | player.leaderstats.KOs.Value = player.leaderstats.KOs.Value + 10 |
6 | end |
7 | end ) |