Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can i make sound play on custom range?ou

How can I make sound play on custom range?

1 comment

0

You can try changing the volume property.

1 answer

✓ Accepted answer

Make a song in workspace called Sound. Make sure it doesn't run at start and is Pitch 1.

I actually don't know, but... The best is to, make hidden parts, and put the sound into each player's PlayerGui using this simple localscript in StarterGui:

local Player = game:service('Players').LocalPlayer

local Song = game:service('Workspace'):findFirstChild('Sound'):Clone()
Song.Parent=Player.PlayerGui
Song:Play()

Now, this is the script (Normal one) you put inside the 'ghost walls' you made:

script.Parent.Touched:connect(function(part)
   if part.Parent:findFirstChild('Humanoid')~=nil then
   local Pl = game:service('Players'):GetPlayerFromCharacter(part.parent)
      if (Pl~=nil) then
        Pl.PlayerGui.Sound:Destroy()
      end
  end
end)

Hope this helps! If not tell output! If it helps and works please make this correct answer :333 ~marcoantoniosantos3

2 comments

0

Change findFirstChild to FindFirstChild

0

@above there is actually no difference in that... It's the same method. If you wanna make code your way, change it in your code, but ill code in my way

This discussion is preserved as it was. New answers, comments, and votes are closed.