After touching the part the part destroy himself and give u 25 coins After 3 sec he's Resummoning, But the script doesn't detect it anymore somewhy so the touched work only in the first time.. Any idea how to fix it??
local Folder = game.Workspace:WaitForChild("Coins")
local Coin = Folder:WaitForChild("Coin1")
local GetCoin = Folder:FindFirstChild("Coin1")
local Debounce = true
local Rep = game:GetService("ReplicatedStorage")
local Event = Rep:WaitForChild("TouchedCoin")
Coin.Touched:Connect(function(Hit)
local LocalPlr = game:GetService("Players").LocalPlayer
local Hum = Hit.Parent:WaitForChild("Humanoid")
local Plr = game.Players:GetPlayerFromCharacter(Hit.Parent)
if Folder:FindFirstChild("Coin1") then
if Plr == LocalPlr then
if Debounce == true then
Debounce = false
Event:FireServer()
wait(3)
Debounce = true
end
end
end
end)
