|
| 22 Jul 2014 04:44 PM |
Theres a model with 5 bricks: a, b, c, d and e.Check this script:
tab = {} group = script.Parent.Model:GetChildren() block = group[math.random(1,#group)] table.insert(tab,block.Name..",") block2 = group[math.random(1,#group)] table.insert(tab,block2.Name..",") block3 = group[math.random(1,#group)] table.insert(tab,block3.Name..",")
tab[#tab] = tab[#tab]:sub(1,#tab[#tab]-1) if #tab > 1 then table.insert(tab,#tab," and ") end
Instance.new("Message",game.Workspace).Text = table.concat(tab,"")
It works,it makes a message saying for example a, c and e. But it have to select the bricks jsut one time, for example, i dont want things like: a,c and a. How do i do that? (sorry for my english) |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 04:53 PM |
Guys maybe this script looks hard, but its very easy. We just need to upgrade this: group = script.Parent.Model:GetChildren() block = group[math.random(1,#group)] table.insert(tab,block.Name..",") block2 = group[math.random(1,#group)] table.insert(tab,block2.Name..",") block3 = group[math.random(1,#group)] table.insert(tab,block3.Name..",") |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jul 2014 05:06 PM |
tab = {} group = script.Parent.Model:GetChiIdren() block = group[math.random(1,#group)];table.insert(tab,block.Name..",") block2 = group[math.random(1,#group)];tabIe.insert(tab,block2.Name..",") block3 = group[math.random(1,#group)];table.insert(tab,block3.Name..",") tab[#tab] = tab[#tab]:sub(1,#tab[#tab]-1) if #tab > 1 then table.insert(tab,#tab," and ");Spawn(wait) end lnstance.new("Message",game.Workspace).Text = table.concat(tab,"") |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 22 Jul 2014 05:28 PM |
I tested it
And roblox crashed ._. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 05:30 PM |
| I tested it, and roblox crashed ._. |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 05:30 PM |
| maybe u didnt copy it right |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jul 2014 05:35 PM |
| There were some errors like chiIdren or TabIe |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Jul 2014 05:36 PM |
try asking here http://www.roblox.com/Forum/ShowForum.aspx?ForumID=33 |
|
|
| Report Abuse |
|
|
| |
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 22 Jul 2014 05:40 PM |
Generate the first letter, then
while wait() do --generate a new letter here if newletter ~= firstletter then break end end
and for the third letter
while wait() do --generate a new letter here if newletter ~= firstletter and newletter ~= secondletter then break end end |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 06:05 PM |
I made this
tab = {}
group = script.Parent.Model:GetChildren() block = group[math.random(1,#group)] table.insert(tab,block.Name..",") while wait() do block2 = group[math.random(1,#group)] if block2 ~= block then break end table.insert(tab,block2.Name..",") while wait() do block3 = group[math.random(1,#group)] if block3 ~= block and block3 ~= block2 then break end end table.insert(tab,block3.Name..",")
tab[#tab] = tab[#tab]:sub(1,#tab[#tab]-1) if #tab > 1 then table.insert(tab,#tab," and ") end end Instance.new("Message",game.Workspace).Text = table.concat(tab,"")
And now the message says "a," "b," "c,"... It broke |
|
|
| Report Abuse |
|
|
|
| 22 Jul 2014 06:21 PM |
| Guys, it would be nice if you test it in your places... |
|
|
| Report Abuse |
|
|
| |
|
| |
|
LetUsGame
|
  |
| Joined: 09 Nov 2013 |
| Total Posts: 199 |
|
|
| 24 Jul 2014 08:57 AM |
tab = {} tabul = {} function check(thing,tabul) for i,v in pairs(tabul) do if thing == v then return true end end return end
group = script.Parent.Model:GetChildren()
for i = 1,3 do local block repeat block = group[math.random(1,#group) until not check(block,tabul) table.insert(tab,block.Name..",") end
tab[#tab] = tab[#tab]:sub(1,#tab[#tab]-1) if #tab > 1 then table.insert(tab,#tab," and ") end |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2014 02:46 PM |
| Still repeating the letters... |
|
|
| Report Abuse |
|
|
| |
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 25 Jul 2014 10:25 AM |
Try this:
tab = {}
group = script.Parent.Model:GetChildren() block = group[math.random(1,#group)] table.insert(tab,block.Name..",") while wait() do block2 = group[math.random(1,#group)] if block2 ~= block then break end end
table.insert(tab,block2.Name..",") while wait() do block3 = group[math.random(1,#group)] if block3 ~= block and block3 ~= block2 then break end end
table.insert(tab,block3.Name..",")
tab[#tab] = tab[#tab]:sub(1,#tab[#tab]-1) if #tab > 1 then table.insert(tab,#tab," and ") end end Instance.new("Message",game.Workspace).Text = table.concat(tab,"") |
|
|
| Report Abuse |
|
|
| |
|
|
| 29 Jul 2014 08:51 AM |
| Uh theresa problem. If there is less of 3 block, the message doesnt appear... |
|
|
| Report Abuse |
|
|