This is my script, could someone please point out my mistakes so that I can fix them?
local floor = game.Workspace:WaitForChild("bmusicplayer")
local Players = game:GetService("Players")
local debounce = false
local clone = workspace.clonedsound:Clone()
local player = game.Players.LocalPlayer
floor.Touched:Connect(function(hit)
if not debounce then
debounce = true
clone.Volume = 0.1
clone.Playing=true
clone.Parent = player.PlayerGui
wait(1)
debounce = false
end
workspace.mainfloor.Touched:Connect(function(hit)
clone:Destroy()
end)
end)

1 comment
You're destroying the only clone that actually exists. Create your clone within your event, instead. Also, you may want to consider Disconnecting the second .Touched after destroying the clone. local event = workspace.mainfloor.Touched:Connect(function(hit) clone:Destroy() event:Disconnect() end)