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