I wasn't completely sure how to word this title but pretty much I have a random number generating then I check what it came up as. Pretty much I'm wondering if theres a way to check if it is a number between say 1-5 rather than typing it all out. Hers part of the script to better show what I mean.
local sp = rng:NextNumber(1, 6) wait(5) if sp == 1 or 2 or 3 or 4 or 5 then
Is there a way to check that range rather than typing one through five?
use relational operators.
if sp >= 1 and sp <= 5 then -- your stuff here end
the code checks if the random number is more than or equal to 1 and less than or equal to 5. good way to check a range of numbers.
Marked as Duplicate by TheeDeathCaster, Programical, Vulkarin, and cabbler
This question has been asked before, and already has an answer. If those answers do not fully address your question, then please ask a new question here.
Why was this question closed?