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

Music won't play when player's stage value changes?

Asked by 3 years ago
Edited 3 years ago

This is in a localscript in StarterCharacterScripts and has a numbervalue child

--script for playing music locally depending on player's stage value

if script.Stage.Value == 2 then
    game.Workspace.Music.Stage1:Stop()
    wait(0.2)
    game.Workspace.Music.Stage2:Play()
end

0
try an integer value pepsymax 73 — 3y
0
Please post the entire script. deeskaalstickman649 475 — 3y
0
This is the entire script shipleydog2 -3 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

You need an Checker that checks all time not just one time so you can use:

local stage = script.Stage

while wait() do
if stage.Value == 2 then
workspace.Music.Stage1:Stop
wait(0.1)
workspace.Music.Stage2:Play()
end
end
Ad

Answer this question