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

Local music script for one person does not even play music? NOT SOLVED

Asked by
Vid_eo 126
8 years ago
Edited 8 years ago

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

1 answer

Log in to vote
0
Answered by 8 years ago

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.

0
The sound works, I'm using it in another script too. No button that's supposed to activate it, it's just supposed to be activated when the player dies or joins, I Vid_eo 126 — 8y
0
Welp, FindFirstChild won't fix it Vid_eo 126 — 8y
0
The music works in studio but not in game Vid_eo 126 — 8y
Ad

Answer this question