Bence24
|
  |
| Joined: 29 Aug 2010 |
| Total Posts: 41 |
|
|
| 23 Jul 2011 03:46 PM |
function findPlayer(partofName,speaker) local finalReturn = { } local pCount = game.Players:GetChildren() -- If the message is "all" if string.lower(partofName) == "all" then for i = 1, #pCount do if pCount[i].className == "Player" then table.insert(finalReturn,pCount[i]) end end
return finalReturn
So this is a short version of my 50-60 line script. So, this returns "1D571078" in edit mode, and it returns similar 'hash' (xd) in solo.
What could be the problem? |
|
|
| Report Abuse |
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 23 Jul 2011 04:18 PM |
you are returning the pointer to that table you need to use a for loop to print everything in the table will post with a sceript next
|
|
|
| Report Abuse |
|
zazw3
|
  |
| Joined: 05 Jul 2008 |
| Total Posts: 1238 |
|
|
| 23 Jul 2011 04:21 PM |
wwwaaaiiiit more complicated than i though can i see whole script? |
|
|
| Report Abuse |
|
Bence24
|
  |
| Joined: 29 Aug 2010 |
| Total Posts: 41 |
|
|
| 23 Jul 2011 04:29 PM |
function findPlayer(partofName,speaker) local finalReturn = { } local pCount = game.Players:GetChildren() -- If the message is "all" if string.lower(partofName) == "all" then for i = 1, #pCount do if pCount[i].className == "Player" then table.insert(finalReturn,pCount[i]) end end -- If the message is "nonadmins" else if string.lower(partofName) == "nonadmins" then for i = 1, #pCount do if isPlayerAdmin(pCount[i].Name) == false then table.insert(finalReturn,pCount[i]) end end -- If the message is "admins" else if string.lower(partofName) == "admins" then for i = 1, #pCount do if isPlayerAdmin(pCount[i].Name) == true then table.insert(finalReturn,pCount[i]) end end -- If the message is "random" else if string.lower(partofName) == "random" then for i = 1, #pCount do local rand = math.random(1,#pCount) table.insert(finalReturn,pCount[rand]) end -- If the message is "guests" else if string.lower(partofName) == "guests" then for i = 1, #pCount do if string.sub(pCount[i].Name,1,5) == "Guest" then table.insert(finalReturn,pCount[i]) end end -- If the message is "me" else if string.lower(partofName) == "me" then table.insert(finalReturn,speaker) -- If the message is "others" else if string.lower(partofName) == "others" then for i = 1, #pCount do if pCount[i].Name ~= speaker then table.insert(finalReturn,pCount[i]) end end -- When it's a normal name finding else for i = 1, #pCount do if string.find(string.lower(pCount[i].Name),string.lower(partofName)) ~= nil then table.insert(finalReturn,pCount[i]) end end end end end end end end end -- Final return return finalReturn end
This is what I have written. |
|
|
| Report Abuse |
|