roblox give player money scrtip code example
Example 1: How to make a cash giving script
game.Players.PlayerAdded:connect(function(p)
local stats = Instance.new("IntValue", p)
stats.Name = "leaderstats"
local money = Instance.new("IntValue", stats)
money.Name = "Cash"
money.Value = 100
while true do
wait(5)
money.Value = money.Value + 100
end
end)
Example 2: How to make cash giving part in roblox studio in lua
script.Parent.ClickDetector.MouseClick:Connect(function(player)
local PlayerPoints = player.leaderstats.Points
PlayerPoints.Value = PlayerPoints.Value + 5
local PlayerExp = player.leaderstats.XP
PlayerExp.Value = PlayerExp.Value + 5
end)