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
 

Please help me this time..

Previous Thread :: Next Thread 
Bence24 is not online. 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 is not online. 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 is not online. 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 is not online. 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
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