How to make cash giving part in roblox studio in lua code example

Example 1: How to make cash giving part in roblox studio in lua

--Make a Part Name it Anything You Want
--Put This Script INSIDE The Part
--Put a Click Detector in
--Officially Made By Rigby#9052 on Discord :D

script.Parent.ClickDetector.MouseClick:Connect(function(player)
	local PlayerPoints = player.leaderstats.Points --Chnage Points With Your Leaderstats Name
	PlayerPoints.Value = PlayerPoints.Value + 5 --Chnage 5 With The Points You Wannt Give 
	
	--Ignore This Below One Only Use If You got 2 leaderstats
	local PlayerExp = player.leaderstats.XP --Chnage Points With Your Leaderstats Name
	PlayerExp.Value = PlayerExp.Value + 5 --Chnage 5 With The Points You Wannt Give 
end) --Dm me On Discord if The Script Has Any Problems My Discord is Rigby#9052

Example 2: 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 --Starter Cash
while true do
wait(5) --Replace "5" With The Seconds You Want The Script To Give money after.
money.Value = money.Value + 100
end
end) --Script By Rigby#9052 on Discord

Tags:

Misc Example