EMAN381
|
  |
| Joined: 27 Nov 2007 |
| Total Posts: 4300 |
|
|
| 27 Oct 2011 07:46 PM |
chats = {"hey", "hello", "hi"} while true do for i=1, #chats do game:GetService("Chat"):Chat(script.Parent, math.random(chats[i]),Enum.ChatColor.Blue) --This does not work. wait(5) end wait(3) end
--Workspace.Head.Script:4: bad argument #1 to 'random' (number expected, got string) |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 27 Oct 2011 07:48 PM |
chats[math.random(i)]
You had the right idea. Btw you're epic. |
|
|
| Report Abuse |
|
|
|
| 27 Oct 2011 07:48 PM |
math.random() requires numbers, not a table... If you want it to chat Randomly, then just use this:
chats = {"hey", "hello", "hi"}
while not false do local ChatText = chats[math.random(1, #chats)] Game:GetService("Chat"):Chat(script.Parent, ChatText, Enum.ChatColor.Blue) wait(8) end |
|
|
| Report Abuse |
|
|
EMAN381
|
  |
| Joined: 27 Nov 2007 |
| Total Posts: 4300 |
|
| |
|