Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can i generate in game cash to players each minute? [closed]

Asked by 4 years ago

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!

0
Use a pcall. PrismaticFruits 842 — 4y

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?

2 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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

0
The above script wont work for FilteringEnabled games and is heavily unsecure. Anybody would be able to change their values. nestriff 27 — 4y
0
I actually used it in my game and it was not unsecure, idk then Shadic1270 136 — 4y
0
This is not a request site for code User#5423 17 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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!

0
This won’t work Ziffixture 6913 — 4y
0
the code should be something similar awesomemode14 68 — 4y
0
This is not a request site for code User#5423 17 — 4y