How to make a coin collect system!

Описание к видео How to make a coin collect system!

In today's video I'm going to show you how to make a coin collecting system.

leaderstats script:

game.Players.PlayerAdded:Connect(function(plr)
local leaderstats = Instance.new("Folder", plr)
leaderstats.Name = "leaderstats"

local Money = Instance.new("IntValue", leaderstats)
Money.Name = "Money" -- set the name to anything you want!
Money.Value = 0 -- set this to any value you want for player to begin with!
end)

Coin Collect script:

debounce = false

script.Parent.Touched:Connect(function()
if debounce == false then
debounce = true
local plr = hit.Parent
local player = plr:GetPlayerFromCharacter(plr)

player.leaderstats.Money.Value += 100 -- set this to any value you want!
script.Parent.Transparency = 1
wait(5)
script.Parent.Transparency = 0
debounce = false
end
end)

Hope you enjoyed the video! Subscribe and Like for more tutorials.

Комментарии

Информация по комментариям в разработке