I want it so that for every model named "Plant" gives 100 "Credits" per 1.5 seconds.
I have the actual money giving script done and perfect, it gives 10 credits every 1.5 seconds, now I want it to add 150 more credits per Plant that exists simultaneously in game.
I have it to where it prints whatever the value of "amount" is every time it adds Credits, it just continuously adds 150 to the already existing 150 making it go up to numbers like 1000 within seconds, this is because it is in a loop, but the script doesn't actually work unless it is in the loop.
Heres the script:
amount = 10
timedelay = 1.5
currencyname = "Credits"
teamcore = 0 -- ignore this
while true do
wait(timedelay)
for i,v in pairs(game.Players:GetPlayers()) do
if v:FindFirstChild("leaderstats") then
v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount
local cash = workspace:FindFirstChild("Plant")
if cash then
yes = true
if yes == true then
amount = amount + 150
print(amount)
end
end
end
end
end
any help please?

1 comment
sorry, I dont know why it jumbled the script together.