|
| 07 Jan 2014 11:58 PM |
function teamteleport(player) if player:IsInGroup(869259) then player:MoveTo(script.Parent.Position +Vector3.new(0,5,0)) end end game.Players.PlayerAdded:connect(teamteleport)
its inside the spawn point. Did I do something wrong? its not teleporting me to the spawn when I join |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2014 12:55 AM |
function checkGroup(groupId) return player:IsInGroup(groupId) end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function() if checkGroup(869259) == true then player:MoveTo(script.Parent.Position + Vector3.new(0, 5, 0)) end end
end) |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2014 12:56 AM |
Oops, don't use that, use this:
function checkGroup(groupId, p) return p:IsInGroup(groupId) end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function() if checkGroup(869259, player) == true then player:MoveTo(script.Parent.Position + Vector3.new(0, 5, 0)) end end
end) |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2014 03:03 AM |
function checkGroup(groupId, p) return p:IsInGroup(groupId) end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function() if checkGroup(869259, player) == true then player:MoveTo(script.Parent.Position + Vector3.new(0, 5, 0)) end end end)
isn't working it says " ')' expected (to close '(' at line 9) near 'end'" |
|
|
| Report Abuse |
|
|
| |
|
Cubyfan22
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 7261 |
|
|
| 08 Jan 2014 03:18 AM |
function checkGroup(groupId, p) return p:IsInGroup(groupId) end
game.Players.PlayerAdded:connect(function(player)
player.CharacterAdded:connect(function() if checkGroup(869259, player) == true then player:MoveTo(script.Parent.Position + Vector3.new(0, 5, 0)) end end) end)
Refugio para el alma perdida - Cubyfan2/CommanderUnity | Add 16,381 Posts |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2014 03:28 AM |
MoveTo() takes a vector3 value as argument. Meaning you can't just say it's a part's position. Also, can't use MoveTo() on a player, need to use the character. Also, by putting the group check in front of the .CharacterAdded you make it more efficient. The script will now only run the check when the person is added to the game rather than every time his character is added. Btw, an if statement only fires when the condition is true unless specified otherwise. So, you don't need to put the "== true" here...
game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(869259) then player.CharacterAdded:connect(function(char) char:MoveTo(Vector3.new(script.Parent.Position) + Vector3.new(0, 5, 0)) end) end end)
It's been a little while, scripting helpers. But I see you still need me :p
-Believe and you will achieve- |
|
|
| Report Abuse |
|
|
Cubyfan22
|
  |
| Joined: 02 Apr 2013 |
| Total Posts: 7261 |
|
|
| 08 Jan 2014 03:28 AM |
^^^^ Simpler version.
Refugio para el alma perdida - Cubyfan2/CommanderUnity | Add 16,381 Posts |
|
|
| Report Abuse |
|
|
|
| 08 Jan 2014 05:00 PM |
game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(869259) then player.CharacterAdded:connect(function(char) char:MoveTo(Vector3.new(script.Parent.Position) + Vector3.new(0, 5, 0)) end) end end) its not teleporting me |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
| 09 Jan 2014 05:54 AM |
"player:MoveTo(script.Parent.Position +Vector3.new(0,5,0))"
If there is an actual spawn block here for a specific team then just put them on the team and kill them. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2014 06:10 AM |
| Been almost a month.... bump |
|
|
| Report Abuse |
|
|