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 » Scripters
Home Search
 

Re: Teleport

Previous Thread :: Next Thread 
ItsRyanJambe is online. ItsRyanJambe
Joined: 11 Nov 2014
Total Posts: 101
27 Apr 2015 11:47 AM
Hi there,

I'm looking to teleport players to another spot and after 20 seconds return the player to the same spot they were just at. Basically, I need to be able to put their location they are at (right before teleportation) as a variable.

Any help is appreciated.

Thanks :)
Report Abuse
ItsRyanJambe is online. ItsRyanJambe
Joined: 11 Nov 2014
Total Posts: 101
27 Apr 2015 12:43 PM
Bump
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
27 Apr 2015 12:52 PM
function teleport (torso,newpos,waitamount)

local firstpos = torso.CFrame

torso.CFrame = newpos

wait(waitamount)

torso.CFrame = firstpos

end

teleport(put the players torso here,CFrame.new(0,0,0),20)

change the CFrame.new(0,0,0) to the new position you want the player to teleport to.

Report Abuse
ItsRyanJambe is online. ItsRyanJambe
Joined: 11 Nov 2014
Total Posts: 101
27 Apr 2015 01:08 PM
function teleport (torso,newpos,waitamount)

local firstpos = torso.CFrame

torso.CFrame = newpos

wait(20)

torso.CFrame = firstpos

end

teleport(game.Players:FindFirstChild(script.Parent.KickeeName.Value).torso,CFrame.new(0,0,0),20)


This "game.Players:FindFirstChild(script.Parent.KickeeName.Value).torso" identifies the player who needs to be teleported or in this case the torso of the player.
Report Abuse
ItsRyanJambe is online. ItsRyanJambe
Joined: 11 Nov 2014
Total Posts: 101
27 Apr 2015 01:08 PM
If you can confirm whether or not that's right as per your suggestion, that would be great :)
Report Abuse
ItsRyanJambe is online. ItsRyanJambe
Joined: 11 Nov 2014
Total Posts: 101
27 Apr 2015 01:42 PM
Bump
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
27 Apr 2015 01:49 PM
Yes that is correct. Right now it would teleport them to 0,0,0, so make sure to change that to whatever you want.
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
27 Apr 2015 01:50 PM
OH NO WAIT

Put .Character before .torso

also change .torso to .Torso
Report Abuse
sloomingbla is not online. sloomingbla
Joined: 28 Jun 2008
Total Posts: 1109
27 Apr 2015 01:51 PM
So

game.Players:FindFirstChild(script.Parent.KickeeName.Value).Character.Torso
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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