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

How to change background music when touching block that doesn't fade with distance?

Asked by 7 years ago
Edited 7 years ago

So I know how to play music when a block is touched but it fades the farther away I get. What I am trying to do is to change the background music once you reach a certain stage of my OBBY. I obviously am doing this wrong but don't know where to begin to fix it. This is what I have when touching a block.

local sound = script.Parent.Sound --The sound object to play

script.Parent.Touched:connect(function(p) --When the parent part is touched
    local human = game.Players:GetPlayerFromCharacter(p.Parent) --Check touching part is part of a Player character
    if human and not sound.IsPlaying then --If player and the sound isn't already playing
        sound:Play() --Play the sound
    end
end)

Any help would be appreciated. Thank you.

1
You would want the sound to be local and if you parent the sound to a base part then it will use 3D sound, parent it to something else to not use 3D sound. User#5423 17 — 7y
0
Yea, like put the sound in a local script and just play it from there QuantumToast 261 — 7y

Answer this question