I'm trying to make a thing that disables the player for an intermission length, then rehabilitate the player after it's over. But I can't figure out how to make it so that this if statement all the time, but when it breaks, it can start again. Any help?

if game.Workspace["Intermission Part"].BrickColor == BrickColor.new(255/255,0/255,0/255) then
	while true do
		wait()
		if game.Workspace["Intermission Part"].BrickColor == BrickColor.new(0/255,255/255,0/255) then
			break
		end
	end
end

5 comments

0

use a "While" this will make the script runs forever

0

using while true do just keeps that script running and it won't go to the thing below it

0

should the ["Intermission Part"] turn red again after? cause if so then just put that code in a while loop.

0

im not quite sure i understand... putting the code in a while true do loop makes the bottom part of the script not work. putting the code in a " while game.Workspace["Intermission Part"].BrickColor == BrickColor.new(255/255,0/255,0/255) do " loop gives me the same problem.

0

Try putting it in a function and calling that function at the bottom