I want to make the script choose any random line of code in the while loop
while true do
print ("Choice1")
print ("Choice2")
print ("Choice3")
print ("Choice4")
end
I want to make the script choose any random line of code in the while loop
while true do
print ("Choice1")
print ("Choice2")
print ("Choice3")
print ("Choice4")
end
creativlyNamedVariable = math.random(1, 4)
if creativlyNamedVariable == 1 then
--code
elseif creativlyNamedVariable == 2 then
--code
elseif creativlyNamedVariable == 3 then
--code
elseif creativlyNamedVariable == 4 then
--code
end
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
The only way I can possibly see this is an array of code lines stored as String in conjunction with loadstring, yet this function is a v e r y bad choice. An alternative option is to Enable a random script.
bro this is easy you have 4k rep what are you DOING