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

How do I teleport a player to an island via text box?

Asked by 2 years ago
Edited by Leamir 2 years ago

Please provide more explanation in your question. If you explain exactly what you are trying to accomplish, it will be much easier to answer your question correctly.
-- Teleport Blocks
local taiga = game.Workspace.Map.Islands.TeleportParts.TeleportPartTaiga
local solar = game.Workspace.Map.Islands.TeleportParts.TeleportPartSolar
local wilderness1 = game.Workspace.Map.Islands.TeleportParts.TeleportPartWilderness1

local player = game.Players.LocalPlayer
local char = player.Character
local humrootpart = player.HumanoidRootPart

script.Parent.FocusLost:Connect(function(enter)
    if enter then
        local Input = script.Parent.Text
        if string.lower(Input) == "blasting taiga" then
            humrootpart.CFrame = CFrame.new()
        end
    end
end)
0
Can you elaborate more please ElongatedMongoose 138 — 2y

1 answer

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

The code kinda had some problems. I don't understand what 'wilderness1' is for tho.

local taiga = game.Workspace.Map.Islands.TeleportParts.TeleportPartTaiga
local solar = game.Workspace.Map.Islands.TeleportParts.TeleportPartSolar
local wilderness1 = game.Workspace.Map.Islands.TeleportParts.TeleportPartWilderness1
script.Parent.FocusLost:Connect(function(enter)
    local player = game.Players.LocalPlayer
    local char = player.Character
    local humrootpart = char.HumanoidRootPart
    if enter then
        local Input = script.Parent.Text
        if string.lower(Input) == "blasting taiga" then
            humrootpart.CFrame = taiga.CFrame
        end
    end
end)
0
Thanks! Also wilderness 1 was for an island it's just a variable for it ArctemiiZ 4 — 2y
Ad

Answer this question