i wanna make a idle tycoon were when you go into a shop you can place a computer and when a progress bar fills at the top of the computer money will be added to the players account and i want a shop to get better equipment how to i do it ?
you can do this
this is For The LeaderBoard
game.Players.PlayerAdded:connect(function(plr) local stats = Instance.new('IntValue',plr) stats.Name = 'leaderstats' local Money = Instance.new('IntValue',stats) Money.Name = 'Money' Money.Value = 0
this will add money
give = false money = game.Players.LocalPlayer.leaderstats.Money if give == false then money.Value = Money.Value + 50 ---you can change 50 to what you want it to increase by give = true end
this is really basic script if you want to make a progress bar you will need to learn about GUI and, tweenSize so it will be smooth, And for the Shop Do this
ocal player = game.Players.LocalPlayer local Rep = game:GetService("ReplicatedStorage") bought = false cost = 100 script.Parent.MouseButton1Click:connect(function() if bought == true then script.Parent.Text = "Already Bought" wait(1) script.Parent.Text = "Bought" else if player.leaderstats.Money.Value < cost then script.Parent.Text = "Not Enough" wait(1) script.Parent.Text = "Buy $100" else if player.leaderstats.Money.Value >= cost then script.Parent.Text = "Bought" Rep.Katana:Clone().Parent = player.Backpack Rep.Katana:Clone().Parent = player.StarterGear -- Change Katana to what you want it to be bought = true player.leaderstats.Money.Value = player.leaderstats.Money.Value - cost end end end end)
ik its a lot of lines but i hope it helped You can Go and Watch AlvinBlox for basic scripting tutorial :D