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 team script

Previous Thread :: Next Thread 
redlo43 is not online. redlo43
Joined: 16 Feb 2011
Total Posts: 4722
25 Sep 2013 09:00 PM
users = {"redlo43", "Epicx4000"}

------------------------------------------------
game.Players.PlayerAdded:connect(function(plyr)
for i = 1, #users do
if(string.upper(name) == string.upper(users[i])) then return true end
return false
end
plyr.TeamColor = BrickColor.new("Bright yellow")
end
end)
Report Abuse
blackboy167thst is not online. blackboy167thst
Joined: 22 Jul 2011
Total Posts: 2468
25 Sep 2013 09:02 PM
I don't understand why would you return in this situation.

~rekt get
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Sep 2013 09:03 PM
return stops the loop.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Sep 2013 09:03 PM
and the function
Report Abuse
redlo43 is not online. redlo43
Joined: 16 Feb 2011
Total Posts: 4722
25 Sep 2013 09:04 PM
how bout this

permission = {"redlo43", "Epicx4000"}

function checOkToLetIn(name)
for i = 1,#permission do
if(string.upper(name) == string.upper(permission[i])) then return true end
end
return false
end

function onPlayerEntered(newPlayer)
print ("Person Spawned")
local human = newPlayer:findFirstChild("Backpack")
if (human~= nil) then
if (checOkToLetIn(human.Parent.Name)) then
human.Parent.TeamColor = BrickColor.new("Bright yellow")
end
end
end

game.Players.ChildAdded:connect(onPlayerEntered)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
25 Sep 2013 09:06 PM
"print ("Person Spawned")
local human = newPlayer:findFirstChild("Backpack")
if (human~= nil) then "

All useless, just use PlayerAdded
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