So im making a game where we are given money every 10 seconds, and i want to add company's that players can buy and get more money from them WITHOUT droppers Here is the script for the money riser, please help me figure this out! Is there any way that I can add lines of code that check to see if the player owns the building "using a value" that gives more money upon money arrival time?
amount = 5 timedelay = 10 currencyname = "Cash" while true do wait(timedelay) for i,v in pairs(game.Players:GetPlayers()) do if v:FindFirstChild("leaderstats") and v then v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount end end end
Uhh, you could add StringValues inside of each the company's buildings, this stringvalue will have the player's name who owns it so when you do that you can do this in advance.
amount = 0 -- changed it to zero so i can times the amount of companies by 5 for money timedelay = 10 currencyname = "Cash" while true do wait(timedelay) amount = 0 for i,v in pairs(game.Players:GetPlayers()) do for _,b in pairs(game.Workspace:GetChildren()) do if b.Name == "Company" then if b.StringValue.Value == v.Name then amount = amount + 1 end end end amount = amount * 5 if v:FindFirstChild("leaderstats") and v then v.leaderstats[currencyname].Value = v.leaderstats[currencyname].Value + amount end end end
Closed as Not Constructive by User#19524
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?