I think your saying every player gets cash every 0.5 seconds. Here is my answer if that is true.
So I'm not to sure why this does not work specifically but I know a solution, in order to make everyone's money increase every 0.5 seconds we need to place a script that increases everyone's money every time.
So put your script in ServerScriptService, make sure it is a server-side script, not a module script or a local script.
In order to do this we are going to use a infinite loop.
So starting our script like this:
local players = game.Players:GetPlayers()
local waitTime = 0.5
local cashAdded - 0.1
while true do
wait(waitTime)
end
Next we are going to iterate, which just means looping through a table.
local players = game.Players:GetPlayers()
local waitTime = 0.5
local cashAdded = 0.1
while true do
for i,v in pairs(players) do
end
wait(waitTime)
end
Then we are going to give everyone extra cash.
local players = game.Players:GetPlayers()
local waitTime = 0.5
local cashAdded = 0.1
while true do
for i,v in pairs(players) do
v.leaderstats.Money.Value = v.leaderstats.Money.Value + cashAdded
end
wait(waitTime)
end
I bet you are confused right now, since you may not know about tables or iterating. I suggest you learn more now and try to make things after. Here is an article about tables:
https://developer.roblox.com/en-us/articles/Table
It may be confusing but try to use your background knowledge.
You can ask me clarification anytime :)
EDIT: Like ArtBlart stated, your Folder name should be "leaderstats" instead of "stats" and adding decimals to leaderstats is probably a bad idea.
1 comment
You should debug your code and figure out when things are running and other details and provide your debugging results. See https://scriptinghelpers.org/help/question-not-descriptive for details