I made a script, and it would fail. Luckily, I tried to fix this script, and would fail. I used brackets to where there was a difference with these section. It still didn't fix, and I tried to combine two scripts into one. Still did not work. It would teleport to one place, not the other. Any solutions?
Faulty Code 1:
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.Model.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.Model.GCTSr.Position) print("Finished") end)
Faulty Script 2:
function onTouched1(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(276614869, player) end end function onTouched2(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(294657972, player) end end script["GCT"].Touched:connect(onTouched1) script["GCTr"].Touched:connect(onTouched2)
Faulty Script 2, line 15 and 16 was missing the .
for Touched
, script["GCT"].Touched
.
function onTouched1(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(294657972, player) end end function onTouched2(hit) local player = game.Players:GetPlayerFromCharacter(hit.Parent) if player then game:GetService("TeleportService"):Teleport(294657972, player) end end script["GCT"].Touched:connect(onTouched1) script["GCTr"].Touched:connect(onTouched2)
Also please provide what error output is giving you with Faulty Script 1 so people can help.