I'm making a Role playing game. And I want players to play for a certain amount of time ( ex. 1 min) to get some in game points to buy houses, gear, or items. I wanna know how to make a script, and help or recommendations? Thanks!
First of all, you will need to make a leaderboard. Once you're there, you change the value to whatever you want to add it to. I'm assuming you don't know how to make a leaderboard, so I'll give you a bit of code and you should be able to script it from there.
game.Players.PlayerAdded:Connect(function(plr) local stats = Instance.new("IntValue") stats.Name = "leaderstats" stats.Parent = plr local currency = Instance.new("IntValue") currency.Name = "Money" -- change this to the name of your currency currency.Value = 0 -- change this to the starting amount of cash currency.Parent = stats end)
If you really still don't know what to do, I highly suggest searching up loops on the Roblox API Reference (the guide).
Hint..!
for i,v in pairs(game.Players:GetChildren()) do v.leaderstats.Money.Value = v.leaderstats.Money.Value + 10 end
(In the future, please try coding it before posting on this website)