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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: IsInGroup Help

Previous Thread :: Next Thread 
ilel is not online. ilel
Joined: 04 May 2008
Total Posts: 206
12 Aug 2013 11:37 AM
I'm trying to teleport a player when they enter if they are in a group.

game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(680995) then
game.Workspace:FindFirstChild(player).Torso.CFrame = CFrame.new(Vector3.new(31.6, 3.7, -113.2))
end
end)

When I take out the if loop it works, otherwise nothing happens. Is there something I'm missing in the loop?

Thanks.
Report Abuse
Desperian is not online. Desperian
Joined: 07 Feb 2012
Total Posts: 3371
12 Aug 2013 11:41 AM
It shouldn't work when you take out the if statement.

1) The player's character isn't loaded instantly when they join.
2) You're attempting to find the the 'player' object in Workspace. ':FindFirstChild()' takes a string, not userdata.
3) Remember that player's have a 'Character' property.
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
12 Aug 2013 11:51 AM
game.Workspace:FindFirstChild(player.Name).Torso.CFrame = CFrame.new(Vector3.new(31.6, 3.7, -113.2))
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