This is my first question on this website so please consider that if i make any mistake. I have a script that when something touches the can collide = false block it plays music but this applies with other objects such as other players. How can i make it so it knows that the local player is touching the area? here is what i got so far
function onTouched()
game.Workspace.ZONEONEMUSIC:Resume()
end
game.Workspace.ZONEONE.Touched:connect(onTouched)
function endtouch()
game.Workspace.ZONEONEMUSIC:Pause()
end
game.Workspace.ZONEONE.TouchEnded:connect(endtouch)
-- this part is when you teleport outside of the block
function Tele()
game.Workspace.ZONEONEMUSIC:Pause()
end
game.Workspace.TeleportMorphZONE.Touched:connect(Tele)

2 comments
It only works in studio! why wont it work in the roblox player?
Hmm, Since scripts run before the player joins you should add 'wait()' at the very top of the script. This will make the script to wait enough for the player