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

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

Asked by
airkor 10
8 years ago
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
0
Try it in a ServerScript ISellCows 2 — 8y
0
the sounds in server script? airkor 10 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

You just made a silly mistake.

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

0
PLEASE ACCEPT ANSWER IF THIS ANSWERED THE QUESTION supermanswaqq 65 — 8y
Ad

Answer this question