Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i make the music change in diffrent areas?

Asked by 9 years ago

i would like to know how to do so i really wanna know and if its already answered then im sorry but i wouls really like to actully know how it is done for example in a obby when you go on a area for example final five then i want to music to change to something dramatic to the soundtrack so the player can really know that the person is on the last few stages just like super checkpoint

2 answers

Log in to vote
1
Answered by 9 years ago
function onTouch(hit)
    local character = hit.Parent
    local Player = game.Players:GetPlayerFromCharacter(character)
    local sound = Instance.new("Sound")
sound.SoundId = "-- replace this with a sound ID (keep the Quotes)"
sound.Parent = Player.PlayerGui
sound:Play()
end
script.Parent.Touched:connect(onTouch)

try this. Just make a uncollidable wall and stick this in it as a script. It should work.

0
but shoudl the script be inside the wall part? its what i dont get tordenask 1 — 9y
0
it makes no sense too tordenask 1 — 9y
0
You add the script inside the wall part. Litterly Conmmander 479 — 9y
0
yea but do i also add the sound inside the wall? like thats what i dont get tordenask 1 — 9y
View all comments (2 more)
0
i got it tordenask 1 — 9y
0
Your welcome Conmmander 479 — 9y
Ad
Log in to vote
0
Answered by 9 years ago

Well my way of doing it is making a wall on that platform and then when the player touches it it changes the music.

local sound = --URL of Sound ID--

script.Parent.Touched:connect(function()
sound.Play = true
end

hopefully this works I didn't really test this, my friend gave it to me.

0
do i add the script the the wall the plaer touches? tordenask 1 — 9y

Answer this question