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

This ScreenGUI won't teleport me?

Asked by 8 years ago

It's supposed to teleport you somewhere, here is the script

local screenGui = Instance.new("ScreenGui")
screenGui.Parent = script.Parent

-- Create TextButton
local textButton = Instance.new("TextButton")
textButton.Parent = screenGui
textButton.Position = UDim2.new(0, 25, 0, 50)
textButton.Size = UDim2.new(0, 150, 0, 50)
textButton.BackgroundColor3 = BrickColor.White().Color
textButton.Text = "TELEPORT"

button = script.Parent
player = game.Players.LocalPlayer
function teleport()
    local torso = player.Character.Torso
    torso.CFrame = game.Workspace.Part.CFrame()
end

button.MouseButton1Click:connect(teleport)

1 answer

Log in to vote
0
Answered by 8 years ago

Looks like the script works find to me, My question would be where are you putting this script? Or what is the parent? I recommend a local script inside of the player's GUI. Else if you have FilteringEnabled on you'll have to use Remote Events, or Functions. Let me know if that fixes it.

0
I moved it to my PlayerGUI and still nothing. I know nothing about FIlteringEnabled, Remove Events, or Functions. SeitaiShi 0 — 8y
0
What is the parent? User#5748 20 — 8y
Ad

Answer this question