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

Can I use compound inequalities in lua?

Can I use compound inequalities to spawn a number of npcs? Like 250>npc>100.

3 comments

0

Do you mean a random number between 100 and 250?

0

Yes

0

But the number is the number of npcs that spawn

1 answer

✓ Accepted answer

What you can do is use math.random() to get a random number between a range.

Just make a for loop and give it a random number between 100 and 250

for i=1,math.random(100,250) do
	--spawn npc
	--"i" is the current npc it is on
	print("this is the "..i.." npc that was made")
end

3 comments

0

Wait, what do I put for the light blue text?

0

@rilgundam that was just an example, you want to spawn your npc inside the for loop

0

Oh ok thx.

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