Last active
February 8, 2025 15:25
-
-
Save ohusq/e1b1d99dd4e1d80c824511166d59217a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local players = game:GetService("Players") | |
players.PlayerAdded:Connect(function(player) | |
local leaderstatsFolder = Instance.new("Folder") | |
leaderstatsFolder.Name = "leaderstats" | |
leaderstatsFolder.Parent = player | |
local cash = Instance.new("NumberValue") | |
cash.Name = "Cash" | |
cash.Parent = leaderstatsFolder | |
cash.Value = 50 | |
end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local players = game:GetService("Players") | |
players.PlayerAdded:Connect(function(player) | |
while task.wait(5) do -- Delay for 5 seconds for each time money gets added | |
local leaderstats = player:FindFirstChild("leaderstats") | |
if leaderstats then -- Check if leaderstats is inside of the player | |
local money = leaderstats:FindFirstChild("Cash") | |
if money then -- "Checks if money exists" | |
money.Value = money.Value + 1000 -- Add 1000 money | |
else | |
warn("Couldn't find the 'Cash' leaderstat, probably because your object name for money is different") -- Pops up if it can't find your money object | |
end | |
end | |
end | |
end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
game:GetService("Players").YOURUSERNAME.leaderstats.Cash.Value = 50 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment