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

I need help with my teleport to coordinates gui button?

Asked by 7 years ago

could someone please tell me what i did wrong here? i got annoyed by the teleport to brick so im trying to do teleport to the coordinates could somone tell me what i did wrong

wait(1)
player = game.Players.LocalPlayer
button = script.Parent



function teleportIsland()
    CFrame = Cframe.newVector3(-412.5, 887.5, 2974)
end

button.MouseButton1Click:connect (teleportIsland)
0
i had to add the question mark in the question Ssj4Gokhan10 14 — 7y

1 answer

Log in to vote
0
Answered by
DeepDev 101
7 years ago

You haven't defined the Character and his Target Location. This is the full script that you need in your GUI Button:

wait(1)
player = game.Players.LocalPlayer --This is your defined player.
character= player.Character --This is your character
button = script.Parent -- Button

function teleportIsland()
    character.Torso.CFrame = CFrame.new(-412.5, 887.5, 2974) --Target Location
end

button.MouseButton1Click:connect (teleportIsland)

I'm not that great in explaining but that will do.

0
thx and no need for the explanation i get it Ssj4Gokhan10 14 — 7y
Ad

Answer this question