I made a part that when you touch it, music is supposed to start playing. The script is not local and the output says nothing. Help?
local debounce = true
script.Parent.Touched:connect(function(hit)
if hit and hit.Parent:FindFirstChild('Humanoid') and debounce then
debounce = false
local player = game.Players:GetPlayerFromCharacter(hit.parent)
local musicplaying = player:WaitForChild('PlayerScripts', 0.1):FindFirstChild('MusicPlaying')
if musicplaying.Value == false then
local randommusic = math.random(1,3)
if randommusic == 1 then
game.Workspace.music.lobbymusic.lobbymusic:Play()
musicplaying = true
elseif randommusic == 2 then
game.Workspace.music.lobbymusic.lobbymusic2:Play()
musicplaying = true
elseif randommusic == 3 then
game.Workspace.music.lobbymusic.lobbymusic3:Play()
musicplaying = true
end
end
end
end)

1 comment
all it does is delete the parent. output says nothing still.