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: if a variable matches a player?

Previous Thread :: Next Thread 
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
17 Aug 2011 06:24 PM
Would this work?

_G.player1 = "BobGeorgenworn"

x = game.Players:GetChildren()
for i = 1 #x do
if i.Name == _G.player1 then
i:BreakJoints()
end
end

I just made this right now, so I have no idea if it works...
if it doesn't work, how can it be fixed?

-Bob
Report Abuse
TheNewScripter is not online. TheNewScripter
Joined: 02 Mar 2010
Total Posts: 2432
17 Aug 2011 06:26 PM
'i' is undefined... I think you mean:

x = Players:children()
for i = 1, #x do
if (x.Name == _G.player) then
x.Character:BreakJoints()
end
end

You should test it before you post it... Just a future note :3
Report Abuse
BobGeorgenworn909 is not online. BobGeorgenworn909
Joined: 03 Apr 2008
Total Posts: 1161
17 Aug 2011 06:28 PM
Ok thanks... you can use Players:children() instead of :GetChildren() ??
Report Abuse
malachi11 is not online. malachi11
Joined: 07 May 2008
Total Posts: 2420
17 Aug 2011 06:40 PM
Yes. :children() is the same as :GetChildren()
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