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: Why isn't this working?

Previous Thread :: Next Thread 
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
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
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
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
tuxedoman23 is not online. tuxedoman23
Joined: 24 Apr 2009
Total Posts: 4670
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
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
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
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
08 Jan 2014 03:03 AM
bump
Report Abuse
Cubyfan22 is not online. 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
juzzbyXfalcon is not online. juzzbyXfalcon
Joined: 02 Feb 2011
Total Posts: 1311
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 is not online. 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
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
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
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
08 Jan 2014 05:01 PM
to the spawn when I join
Report Abuse
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
08 Jan 2014 05:01 PM
bump
Report Abuse
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
08 Jan 2014 05:26 PM
bump
Report Abuse
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
08 Jan 2014 08:23 PM
bump
Report Abuse
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
09 Jan 2014 12:53 AM
bump
Report Abuse
TheInnovative is not online. TheInnovative
Joined: 31 Dec 2008
Total Posts: 23486
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
deathfire989 is not online. deathfire989
Joined: 15 Nov 2012
Total Posts: 262
22 Jan 2014 06:10 AM
Been almost a month.... bump
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