How to Teleport When Pressing on a Button
Download – Teleport Script
How To – Teleport When Pressing on a Button in Roblox Studio
What’s up everyone welcome to buzzygames, my name is BuzzyGamesBeth and today I’ll be teaching you how to teleport when pressing on a button in Roblox studio!
- Let’s learn how to teleport when we’re pressing a button. A teleport GUI is going to be our part.
- First thing we want to do is create our teleport part that we want to teleport to. All I’m going to do is spawn in a part, change the color (go ahead and manipulate the part to whatever you want). I’m going to drag this part inside of an arena that I’ve made and have used in previous videos. Anytime I click on the teleport GUI button, I’ll be teleported to that blue part.
- Let me go ahead and drag that inside the arena. Go ahead and untick can collide so that when we teleport on it, we won’t get stuck inside of the part. You can change the transparency of it to 1.
- Create another part. This is going to be our button. Our button is going to be inside of this part so grab a part, resize it, reshape it to however you want. Inside of our starter GUI, go ahead and add a surface GUI. Inside of our surface GUI, let’s go ahead and add a frame. Inside of our frame let’s add a text button, not a label. Inside of our surface GUI let’s go ahead and adornee our part so that the surface GUI is going to be inside of this gray part that we want to have the frame on.
- Change the face of that the frame and go ahead and resize/position it to however you want. Play around with these numbers. It takes a while to get to the area that you want, so take your time. Once the text button is in your desired area (for me it’s just going to be in the middle of this part), go ahead and resize or scale the text font and color. I’m gonna go ahead and add a UI corner to have a rounded corner.
- We’re going to add one more thing inside of our text button. Let’s go ahead and add a local script. We’re going to go ahead and write down our variable. We have a d-bounce and a function where anytime if we click on this button, then we’ll get teleported to our teleport part. I renamed that blue part that we created in the beginning to teleport part. Whatever you rename that part to, we’re going to reference it in this function.
- We’re going to have a wait so that people can’t really spam this button. That’s it! When we hop inside of our game, anytime we click on this teleport button, we will get teleported to that blue part.