Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a Teleport GUI that isn't based off of an object?

Asked by 6 years ago

So, I wanted to make a Teleport GUI that isn't based off of an object

What I mean by "based" is that when you touch that object, you get teleported to the coordinates that you placed in the script, or when you click a button on the GUI, it teleports you to an object.

What if I just want the button to be pressed, and you're just teleported to the coordinates?

0
`Part.CFrame = CFrame.new(1,1,1)` TheeDeathCaster 2368 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

local script, when you click the button it will fire an event

event=game:GetService("ReplicatedStorage"):WaitForChild("GuiTeleport")
textbutton.MouseButton1Click:connect(function()

event:FireServer()

end)

server script when the event is fired, it teleports the player to the coordinates

event=Instance.new("RemoteEvent")
event.Name="GuiTeleport"
event.Parent=game:GetService("ReplicatedStorage")
event.OnServerEvent:connect(function(player)

    player.Character.HumanoidRootPart.CFrame=CFrame.new(PUT YOUR CORDINATES HERE)

end)

0
Let me know if you have any questions Earthkingiv 51 — 6y
0
In the first script, there's an issue with the "textbutton". I placed a LocalScript inside the ScreenGui with both scripts. OverdueCave -14 — 6y
0
there should be: local textbutton = script.parent 222ono222 47 — 6y
0
If the script is inside the text button. If it isn't: local textbutton = game.StarterGui.ScreenGui.TEXTBUTTONNAME 222ono222 47 — 6y
Ad

Answer this question