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 » Scripting Helpers
Home Search
 

Re: Help me plz

Previous Thread :: Next Thread 
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:02 PM
...
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:19 PM
...

I dont see the change
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
22 Jul 2014 05:20 PM
U DIDNT EVEN TEST IT
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:28 PM
I tested it

And roblox crashed ._.
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:30 PM
I tested it, and roblox crashed ._.
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
22 Jul 2014 05:30 PM
maybe u didnt copy it right
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:32 PM
Ops... double message :I
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:35 PM
There were some errors like chiIdren or TabIe
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 05:35 PM
You wrote i instead of l
Report Abuse
BothAngles is not online. BothAngles
Joined: 01 Dec 2011
Total Posts: 9604
22 Jul 2014 05:36 PM
try asking here
http://www.roblox.com/Forum/ShowForum.aspx?ForumID=33
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
22 Jul 2014 05:37 PM
while true do end
Report Abuse
Kodran is not online. 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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
22 Jul 2014 06:21 PM
Guys, it would be nice if you test it in your places...
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
23 Jul 2014 06:34 AM
...
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
24 Jul 2014 08:49 AM
Help me please
Report Abuse
LetUsGame is not online. 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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
24 Jul 2014 02:46 PM
Still repeating the letters...
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
25 Jul 2014 10:15 AM
D:
Report Abuse
Kodran is not online. 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
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
29 Jul 2014 08:50 AM
YEAH it works. Thx you :D
Report Abuse
masterjosue1998 is not online. masterjosue1998
Joined: 21 Feb 2011
Total Posts: 949
29 Jul 2014 08:51 AM
Uh theresa problem. If there is less of 3 block, the message doesnt appear...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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