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!
Hello, i have a script that can help you
Put this in a script, in starter gui
1 | local player = script.Parent.Parent |
2 | local leaderboard = player:WaitForChild( "leaderstats" ) |
3 | local points = leaderboard:WaitForChild( "Points" ) |
4 |
5 | while wait( 3 ) do -- time to wait, change it to any time you want. |
6 | points.Value = points.Value+ 1 -- points it gives, change it to any value you want. |
7 | end |
Put this in a script, in workspace
1 | game.Players.ChildAdded:connect( function (player) |
2 | local stats = Instance.new( "Model" ,player) |
3 | stats.Name = "leaderstats" |
4 | local money = Instance.new( "IntValue" ,stats) |
5 | money.Name = "Points" -- This is money name, change it to Cash or whatever you want |
6 | money.Value = 0 -- Starting money people have, you can change it too |
7 | money.Parent = stats |
8 | end ) |
if this is correct, please accept this answer
Just put an increment script such as (part of your code):
1 | local value = game.Players.leaderstat.Cash.Value --just an example, change the directory |
2 |
3 | while true do |
4 | wait( 60 ) |
5 | value = value + 1 |
6 | end |
The code should be something similar.
Hope This Helps!
Closed as Not Constructive by PrismaticFruits and User#5423
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?