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

Why is my character did not teleport to another place?

Asked by
mine248 40
8 years ago

I expanded my script and it would not teleport to the place ID 294657972. Are there any solutions?

Faulty script:

local player = game.Players.LocalPlayer
local Background1 = script.Parent:WaitForChild("Background1")
local Background2 = script.Parent:WaitForChild("Background2")
local Background3 = script.Parent:WaitForChild("Background3")
local Background3a = script.Parent:WaitForChild("Background3a")
local SBackground = script.Parent:WaitForChild("ShuttleBackground")
local SBackgrounda = script.Parent:WaitForChild("ShuttleBackgrounda")
local Shade = SBackground:WaitForChild("Shade")
local Select = Shade:WaitForChild("Select")
local Shadea = SBackgrounda:WaitForChild("Shade")
local Selecta = Shadea:WaitForChild("Select")
local Shuttle1 = Select:WaitForChild("Shuttle1") --Grand Central Shuttle
local Shuttle2 = Select:WaitForChild("Shuttle2") --Franklin Avenue Shuttle
local Shuttle3 = Select:WaitForChild("Shuttle3") --Rockaway Park Shuttle
local Shuttle1a = Selecta:WaitForChild("Shuttle1") --Grand Central Shuttle
local Shuttle2a = Selecta:WaitForChild("Shuttle2") --Franklin Avenue Shuttle
local Shuttle3a = Selecta:WaitForChild("Shuttle3") --Rockaway Park Shuttle


script.Parent.Background1.Play.MouseButton1Click:connect(function()
    Background1:Destroy()
    Background2.Active = true
    Background2.Visible = true
end)

script.Parent.Background2.Normal.MouseButton1Click:connect(function()
    Background2:Destroy()
    Background3.Active = true
    Background3.Visible = true
end)

script.Parent.Background2.Race.MouseButton1Click:connect(function()
    Background2:Destroy()
    Background3a.Active = true
    Background3a.Visible = true
end)

script.Parent.Background3.Shuttle.MouseButton1Click:connect(function()
    Background3:Destroy()
    SBackground.Active = true
    SBackground.Visible = true
end)

script.Parent.Background3a.Shuttle.MouseButton1Click:connect(function()
    Background3a:Destroy()
    SBackgrounda.Active = true
    SBackgrounda.Visible = true
end)

script.Parent.ShuttleBackground.Play.MouseButton1Click:connect(function()
    Select.Active = true
    Shade.Visible = true
end)

script.Parent.ShuttleBackgrounda.Play.MouseButton1Click:connect(function()
    Selecta.Active = true
    Shadea.Visible = true
end)

--IGNORE
script.Parent.ShuttleBackground.Shade.Select.Shuttle1.MouseButton1Click:connect(function()
    game:GetService("TeleportService").CustomizedTeleportUI = true
    Shuttle1:Destroy()
    Shuttle2:Destroy()
    Shuttle3:Destroy()
    Select.Title:Destroy()
    Select.Loading.Visible = true
    print("Ready")
    player.Character:MoveTo(game.Workspace.GCTS.Position)
    print("Finished")
end)

--ERROR PART
script.Parent.ShuttleBackgrounda.Shade.Select.Shuttle1.MouseButton1Click:connect(function()
    game:GetService("TeleportService").CustomizedTeleportUI = true
    Shuttle1a:Destroy()
    Shuttle2a:Destroy()
    Shuttle3a:Destroy()
    Selecta.Title:Destroy()
    Selecta.Loading.Visible = true
    print("Ready")
    player.Character:MoveTo(game.Workspace.GCTSr.Position)
    print("Finished")
end)

Faulty script 2:

function onTouched(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    if player then
    game:GetService("TeleportService"):TeleportToSpawnByName(294657972, "TSSpawn", player)
    end
end

script.Parent.Touched:connect(onTouched)

Answer this question