The sound always plays after it comes back, what should I do
local coinPart = script.Parent
local toggle = false
local amount = 100
coinPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) ~= nil and not toggle then
coinPart.Sound:Play()
toggle = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local leaderstats = player:FindFirstChild(“leaderstats”)
local coins = leaderstats.Gold
coins.Value = coins.Value + amount
local coinClone = coinPart:Clone()
coinPart:Destroy()
wait(10)
coinClone.Parent = workspace
toggle = false
end
local coinPart = script.Parent
local toggle = false
local amount = 100
coinPart.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild(“Humanoid”) ~= nil and not toggle then
coinPart.Sound:Play()
toggle = true
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local leaderstats = player:FindFirstChild(“leaderstats”)
local coins = leaderstats.Gold