I'm trying to make a script that changes music when you walk from one area to another. I have the script that plays music down, but i have no clue how to make it change. Here's the script for putting the sound in, so you can center your answer off of it.
debounce = false
script.Parent.Touched:connect(function(hit)
if not debounce then
debounce = true
if(hit.Parent:FindFirstChild("Humanoid")~=nil)then
while true do
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
local sound = script.Parent.Sound:Clone()
sound.Parent = player.PlayerGui
sound:Play()
wait(118.021)
end
debounce = false
end
end
end)

1 comment
Thank you so much. I didn't think i would get a response so fast, looks like ill be using this site more often.