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

If you click 1 on a GUI It teleports you to Level 1?

Asked by
s_21 74
6 years ago

I'm having trouble with something.

I have made a GUI with numbers 1-9 on it, But I need it so when you click 1 It teleports you to level one, When you Click 2 It teleports you to level , So on and so on.

If you can help me it'd be greatly appreciated! Thanksss!

1
This is a request, not allowed on this website. You must try it first! User#21527 0 — 6y
3
What do you mean by "GUI with numbers 1-9"? Want to make sure you actually did make 1-9 buttons before answering. Le_Teapots 913 — 6y
1
Did, Dont worry xd @tiraner s_21 74 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
-- In a local script
player = game.Players.LocalPlayer
button = script.Parent
newplace = CFrame.new(0, 0, 0) -- where to teleport to
function Clicked()
    if player.Character then
        player.Character.Torso.Anchored = true
        wait()
        player.Character.Torso.CFrame = newplace
        wait()
        player.Character.Torso.Anchored = false
    end
end
button.MouseButton1Click:connect(Clicked)

Put this in a Gui textbutton for each level

Ad

Answer this question