Advertisement
Guest User

Play music in different areas script 4 zaine

a guest
Jul 21st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. script.Parent.Touched:connect(function(hit)
  2.     if hit.Parent:FindFirstChild("Humanoid") then
  3.         local player = game.Players:FindFirstChild(hit.Parent.Name)
  4.         if player.PlayerGui.Sound.SoundId ~= "" then -- Insert sound id here
  5.             player.PlayerGui.Sound:Stop() -- Stops any sound playing
  6.             player.PlayerGui.Sound.SoundId = "" -- edit this sound id here also
  7.             player.PlayerGui.Sound:Play() -- Plays the SoundId
  8.         end
  9.     end
  10. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement