Roblox Studio Tutorials - October 6, 2021

How to Teleport by Pressing any Key


Buzzy Beth


Download – Teleport Script

How To – Teleport by Pressing any Key

What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to teleport by pressing any key!

  • First thing we want to do is I want to teleport to this blue part right over here. We’re going to add a localscript inside of startercharacterscripts.
  • Before we write any code though make sure to find and copy and paste the position of your part which we’ll be pasting into our code in the localscript.
  • So inside of our script we have our variable and then we’re going to create a function where if any time a key code that is assigned is pressed, then our player is going to get teleported to the part.
  • Inside of this parentheses is going to be the position of your part that you want to paste in. Then we’ll call our function in the end and then that’s it!
  • Now go ahead and just hop into your game and remember I pressed t i said that it has to teleport me. Right now when I teleported, I kind of fell (into the part) so what i’m gonna do is change the 0.50 (y-axis) to any number from one to five. So that I teleport above the part that i’m teleporting to and don’t get stuck in the middle ofit -i’m gonna do 5.
  • I’m gonna hop back into my game, i’m gonna press “t” and I should teleport right onto my part and just like that you’re done!