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

How to fix this script regarding a loop in play music in a game?

while true do
	wait(1)
	game.Workspace.Sound.Play()
	wait(120)
	game.Workspace.Sound2.Play()
	wait(81)
	game.Workspace.Sound3.Play()
	wait(121)
	game.Workspace.Sound4.Play()
	wait(120)
	game.Workspace.Sound5.Play()
	wait(76)
	game.Workspace.Sound6.Play()
	wait(118)
end

I tried the script and did not hear the music, can someone show me what is wrong with this?

Edit: this is a local script, would changing it to a server script help? Varying wait times are for how long the songs are.

New Script:


while true do
	wait(1)
	game.Players.Player.PlayerGui.Sound.Play()
	wait(120)
	game.Players.Player.PlayerGui.Sound2.Play()
	wait(81)
	game.Players.Player.PlayerGui.Sound3.Play()
	wait(121)
	game.Players.Player.PlayerGui.Sound4.Play()
	wait(120)
	game.Players.Player.PlayerGui.Sound5.Play()
	wait(76)
	game.Players.Player.PlayerGui.Sound6.Play()
	wait(118)
end

2 comments

0

Try it in a ServerScript

0

the sounds in server script?

1 answer

You just made a silly mistake.

-- Put a : instead of a period.
game.Players.Player.PlayerGui.Sound:Play() -- like so

1 comment

0

PLEASE ACCEPT ANSWER IF THIS ANSWERED THE QUESTION

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