How to get Cash everytime you click a button On Roblox Studio

Опубликовано: 16 Октябрь 2024
на канале: StudioTutorialzYT
127
11

Hello everyone! I hope you all understood and enjoyed this video! If you have any suggestions or questions please comment down below and I'll try my best to answer it! Thank you all for 142 SUBS! Stay safe and have a great day/night!

Baii! 💗

Scripts:

--------- ServerScriptService ---------

game.Players.PlayerAdded:Connect(function(plr)
local stats = Instance.new("IntValue")
stats.Name = "leaderstats"
stats.Parent = plr

local power = Instance.new("IntValue")
power.Name = "Cash"
power.Value = 0
power.Parent = stats
end)


--------- GiveStats Part ---------

local remoteevent = script.Parent.Parent.GiveStats
game.Players.PlayerAdded:Connect(function(plr)
script.Parent.Parent.Parent.ClickDetector.MouseClick:Connect(function()
plr.leaderstats.Cash.Value = plr.leaderstats.Cash.Value + 1 ------- Put how much cash you want the person to get when they click the button
if not plr.leaderstats.Cash.Value + 1 then -------- change the "1" near the "+" to how much cash you want the person to get when they click the button
remoteevent = script.Parent.Parent
remoteevent:FireServer()
end
end)
end)

#RobloxStudioTutorials