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

How can I make a gui that teleports you to the map?

Asked by 10 years ago

How can I make a gui that teleports you to the map. For example your in a lobby and the map changes and teleports you automatically to the lobby, and then you enter the map by clicking that gui?

2 answers

Log in to vote
1
Answered by
Dummiez 360 Moderation Voter
10 years ago

If you want a button to teleport you to the map, something like this.

local plr = game.Players.LocalPlayer
local button = script.Parent

button.MouseButton1Click:connect(function()
    plr.Character.Torso.CFrame = game.Workspace["GUIPart"].CFrame -- name of the block you want to teleport to.
end)
0
Thanks! It works! AlanLogic 0 — 10y
0
Dummiez, Hey man you helped me in scriptinghelpers in what my problem was how to make a gui teleport you in to the game. Therefore, I just had a question in which what it is, how do I make the gui with the script spawn in 3 places randomly choosing them. Thank you! I hope you look forward in helping me out. Sincerely, AlanLogic AlanLogic 0 — 10y
0
Thanks AlanLogic 0 — 10y
Ad
Log in to vote
2
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
10 years ago

on a textbutton, insert a localscript with the following code:

position = Vector3.new(0,0,0) -- CHANGE THIS TO THE POSITION

script.Parent.Button1Click:connect(function()
game.Players.LocalPlayer.Character.Torso.CFrame = CFrame.new(position)
end)
0
Ok, sorry if this sounds dum, but where can I get the position? Do I have to try until its in the spot I want? AlanLogic 0 — 10y
1
The position will be in a part under "Properties" MUSHR0OM 0 — 10y
0
Thanks! AlanLogic 0 — 10y

Answer this question