Hello Scripters! I’m trying to figure out how to make a function which allows a player to receive Money every 10 Seconds, Below is the script I’m currently using, By the way I’m not a scripter at all lol.
wait(.5)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
local score = Instance.new("IntValue")
score.Name = "Money"
score.Value = 0
score.Parent = stats
stats.Parent = newPlayer
end
game.Players.ChildAdded:connect(onPlayerEntered)
Hey, sorry but #help-and-feedback:scripting-support is not a spoon feeding channel(am pretty sure it’s not allowed anyway), meaning we won’t be able to just paste you the ready code. @BurgerBurner gave you the code you use to give the player 5 cash every 10 seconds, you put that after your script already made the leaderboard.
game.Players.PlayerAdded:Connect(function(player)
local MoneyFolder = Instance.new("Folder")
MoneyFolder.Name = "leaderstats"
MoneyFolder.Parent = player
local MoneyValue = Instance.new("IntValue")
MoneyValue.Parent = MoneyFolder
while wait(10) do
MoneyValue.Value = MoneyValue.Value +1
end
end)
Its creating a folder (leaderstats) puting it in the player
then you create a value (Money) and after ten seconds you + 1 to the value
Developer hub is a great tool, you are also welcome to use the devforums but people do expect that you have some coding knowledge, Also keep in mind that lua works from the top, all the way to the bottom. You would put that code under where the values are created/set. @watermill12