So I want it to be so that by default specific music plays when a player spawns, and it ONLY plays for that player. It won't work, NO ONE can hear it. I've tried using functions, different scripts, etc, but nothing works! It's in a local script in ScreenGui. Also, this script works when its enabled by pushing a button or something because I have another script like that too. Script:
ButtonBacking = script.Parent:WaitForChild("ButtonBacking") Player = game.Players.LocalPlayer BlackScreen = script.Parent:WaitForChild("BlackScreen") TeleportButton = ButtonBacking:WaitForChild("TeleportButton") SpawnLabel = script.Parent:WaitForChild("Spawn") local S1 = ButtonBacking:WaitForChild("Sound") local S2 = ButtonBacking:WaitForChild("Sound2") local S3 = ButtonBacking:WaitForChild("Sound3") S1:Play()
Also, none of the variables are wrong.
Thanks! -Clubberoni
There could be several things preventing it from playing. One thing could be that its waiting for something. All the "WaitForChild" could be pausing the script waiting for it to appear. You may want to check spelling on that.
Another thing that could be wrong it maybe you're missing the click event.
local Button2Click = script.Parent.Button2Click ButtonBacking = script.Parent:WaitForChild("ButtonBacking") Player = game.Players.LocalPlayer BlackScreen = script.Parent:WaitForChild("BlackScreen") TeleportButton = ButtonBacking:WaitForChild("TeleportButton") SpawnLabel = script.Parent:WaitForChild("Spawn") local S1 = ButtonBacking:WaitForChild("Sound") local S2 = ButtonBacking:WaitForChild("Sound2") local S3 = ButtonBacking:WaitForChild("Sound3") Button2Click.MouseButton1Click:connect(function() S1:Play() end)
You woud change the "Button2Click" Variable to the button you wanted to active the music.
Another thing might be the sound isn't loading or its not the correct ID. Might wanna double check that.