menu
Roblox Forum Archive
Home
User Search
Forums
Donate
search
settings
Home
User Search
Forums
Donate
launch
Go to User Dashboard
Forums
Scripting Helpers
Random functions (see more)
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right
Random functions (see more)
ninetailfox73
Join Date: 2008-03-11
Post Count: 1954
#64205174
Monday, March 12, 2012 4:46 AM GMT
What would be an example of a script that executes different functions randomly?
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
smurf279
Join Date: 2010-03-15
Post Count: 6871
#64205807
Monday, March 12, 2012 5:06 AM GMT
function a() print"a" end Function b() Print 'B's end function c() print("c") end Funcs = {a, b, c} while wait(2) do Funcs[math.random(#Funcs)]() end
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
ninetailfox73
Join Date: 2008-03-11
Post Count: 1954
#64205954
Monday, March 12, 2012 5:12 AM GMT
Thank you kind sir.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
NXTBoy
Join Date: 2008-08-25
Post Count: 4533
#64222477
Monday, March 12, 2012 8:02 PM GMT
Or more concisely: local functions = { function() print("a") end, function() print("b") end, function() print("c") end } while wait(2) do functions[math.random(#functions)]() end
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
nate890
Join Date: 2008-11-22
Post Count: 21686
#64222534
Monday, March 12, 2012 8:03 PM GMT
^Is how I would do it.
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
smurf279
Join Date: 2010-03-15
Post Count: 6871
#64236902
Monday, March 12, 2012 11:27 PM GMT
Hey I'm on my kindle :P typing is already hard enough without having to worry about all the spell checks while I'm trying to write scripts
Go to point in time
arrow_right
10 minutes before
5 minutes before
At time of posting
5 minutes after
10 minutes after
more_horiz
chevron_left
chevron_left
chevron_left
of
1
chevron_right
chevron_right
chevron_right