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

Trying to make the song not play whilst the audio is inside of StarterGUI, help?

Asked by 7 years ago
while true do
    wait(.1)
if script.Parent.Parent == StarterGui
    then script.Parent.Playing = false
end


if script.Parent.Parent == PlayerGui
    then script.Parent.Playing = true
end
end

1 answer

Log in to vote
0
Answered by
Xduel 211 Moderation Voter
7 years ago
Edited 7 years ago

There is a much simpler solution to this. Because LocalScripts only run in the Player, NOT the server, have the audio default as Playing = false. Then, in the local script, simply put

script.Parent.Parent.Playing = true

So when the player gets the audio, it immediately toggles it to start playing. Hope this helps!

Ad

Answer this question