generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

combo help

Previous Thread :: Next Thread 
lostend is not online. lostend
Joined: 21 Aug 2011
Total Posts: 8265
13 Aug 2015 01:24 PM
local a={
'a';'b';'c';'d';'e';'f';'g';'h';'i';'j';'k';'l';'m';'n';'o';'p';'q';'r';'s';'t';'u';'v';'w';'x';'y';'z'
}

local find=function(tab,val)
local isFound=false
for _,v in next,tab do
if rawequal(v,val) then
isFound=true break
end
end
return isFound
end
local getCombinations=function(tab,len)
local _chars={}
local _combos={}
for i=1,len do
for _,v in next,tab do
_chars[#_chars+1]=v
end
end
local ran={}
local random
for i=1,#_chars do
repeat random=math.random(1,#_chars) until
not find(ran,random)
ran[#ran+1]=random
end
for _,v in next,ran do
_combos[#_combos+1]=_chars[v]
end
print(table.concat(_combos,' '))
end
getCombinations(a,3)

So it works, but I'm not sure on how to make it where it returns a combination of the characters. halp
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image