Help with basic Murder Mystery game script

Like this?

local plrs = game.Players
local ready = false

while true do
	coroutine.resume(coroutine.create(
		while true do
		local num = #plrs:GetPlayers()
		if num > 1 then
			local ready = true 
		else 
			local ready = false 
			
		end
	end)
1 Like

Yes! That’s will should work, if it will not work, try put another ) at end)

1 Like

It still doesn’t work. I don’t know what is going on

1 Like

It’s underlining the word

while

in blue

2 Likes

Do you get any errors? That’s maybe about I writed that wrong.

1 Like

Oh problem is you writed code like wrong position, use coroutine and write it again without copying.

1 Like

Ok, I’ll see if that will work

1 Like

Here is code I writed in a program

coroutine.resume(coroutine.create(function( while true do; local num = #plrs:GetPlayers() if num > 2 then; ready = true else; ready = false end end))

You not need play with it just copy paste and run code

1 Like

I’ve layed it out like this - still not working…

while true do
	coroutine.resume(coroutine.create)
	while true do
		local num = #plrs:GetPlayers()
		if num > 1 then
			local ready = true
		else
			local ready = false
		end
		end
	end
1 Like

Look the new post, it’s because I forget add function thing just copy paste and do not play with code just run the game

1 Like

I entered this and didn’t play with it…

coroutine.resume(coroutine.create(function( while true do; local num = #plrs:GetPlayers() if num < 2 then; ready = true else; ready = false end))
1 Like

Edited script again, try it. I’m really sorry I’m at mobile so I has some mistakes.

1 Like

I just ran it, didn’t work again…

1 Like

Last try it now will work I edited if it will not work I cant help you anymore

1 Like

Just do this:

while true do
	local num = #plrs:GetChildren()
	if num > 1 then
		-- round starting
	else
		-- wait for more players
	end
end
2 Likes

Are you using a regular script in a screengui?

1 Like

Yes, this is a regular script :face_with_raised_eyebrow:

1 Like

You can try this too

1 Like

This worked! Thank you! :grin: :grin:

You all helped a lot though :laughing: