Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- leader stats script
- local Players = game:GetService("Players")
- Players.PlayerAdded:Connect(function(player)
- local leaderstatsFolder = Instance.new("Folder")
- leaderstatsFolder.Name = "leaderstats"
- local Coins = Instance.new("IntValue")
- Coins.Name = "Coins"
- Coins.Value = 5
- leaderstatsFolder.Parent = player
- Coins.Parent = leaderstatsFolder
- end)
- ----------------------------------------------------------end of script ----------------------------------------------------
- --- click detector script (put this inside a part or model)
- local PART = script.Parent
- local clickD = script.Parent.ClickDetector
- local counter = 0
- clickD.MouseClick:Connect(function(player)
- counter+=1
- if counter == 10 then
- counter = 0
- end
- if counter <=3 then
- player.leaderstats.Coins.Value+=5
- print("give coins")
- else
- print("chill out bro")
- return
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement