I'm making a RP game, but I want players to make in game money by waiting and it will go into a money gui. Thanks!
✓ ANSWER ACCEPTED
How can i generate in game cash to players each minute?
2 answers
✓ Accepted answer
Hello, i have a script that can help you
Put this in a script, in starter gui
local player=script.Parent.Parent
local leaderboard=player:WaitForChild("leaderstats")
local points=leaderboard:WaitForChild("Points")
while wait(3)do -- time to wait, change it to any time you want.
points.Value=points.Value+1 -- points it gives, change it to any value you want.
end
Put this in a script, in workspace
game.Players.ChildAdded:connect(function(player)
local stats = Instance.new("Model",player)
stats.Name="leaderstats"
local money = Instance.new("IntValue",stats)
money.Name="Points" -- This is money name, change it to Cash or whatever you want
money.Value=0 -- Starting money people have, you can change it too
money.Parent = stats
end)
if this is correct, please accept this answer
3 comments
0
The above script wont work for FilteringEnabled games and is heavily unsecure. Anybody would be able to change their values.
0
I actually used it in my game and it was not unsecure, idk then
0
This is not a request site for code
Just put an increment script such as (part of your code):
local value = game.Players.leaderstat.Cash.Value --just an example, change the directory
while true do
wait(60)
value = value + 1
end
The code should be something similar.
Hope This Helps!
3 comments
0
This won’t work
0
the code should be something similar
0
This is not a request site for code
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Use a pcall.
please follow https://scriptinghelpers.org/help/how-post-good-questions-answers