I am developing an obby type game where you have to beat the easy level to play the medium level. I'm very confused on what im doing wrong so could someone please help me on this? In the easy obby at the ending you press a textButton which sends you back to the main hub (where you choose difficulties). With this code :
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local LoadingScreen = ReplicatedStorage:WaitForChild("Loading")
script.Parent.MouseButton1Down:Connect(function()
local TempLoadingScreen = LoadingScreen:Clone()
TempLoadingScreen.Parent = PlayerGui
TeleportService:SetTeleportGui(TempLoadingScreen)
TeleportService:Teleport(6956855130, player)
end)
Then in the main hub i've put a script into the "ReplicatedFirst" service which is supposed to let you enter medium obby then. Which has this code
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local LoadingScreen = ReplicatedStorage:WaitForChild("Loading")
local TeleportData = TeleportService:GetLocalPlayerTeleportData()
if TeleportService ~= nil then
local LocalSscript = script:FindFirstChild("LocalScript")
LocalSscript.Disabled = false
end
Inside the script of this one there is ANOTHER script which makes it possible to even teleport :
local StarterGui = game:GetService("StarterGui")
local PlayFrame = StarterGui.WelcomeGui.MainFrame.PlayFrame
local ErrorFrame = PlayFrame.ErrorFrame
local mediumButton = PlayFrame.MediumFrame.TeleportButton
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local PlayerGui = player:WaitForChild("PlayerGui")
local LoadingScreen = ReplicatedStorage:WaitForChild("Loading")
script.Parent.MouseButton1Down:Connect(function()
local TempLoadingScreen = LoadingScreen:Clone()
TempLoadingScreen.Parent = PlayerGui
TeleportService:SetTeleportGui(TempLoadingScreen)
TeleportService:Teleport(6958450459, player)
end)
I have disabled this script because as i showed in the second script i made it so if there is a teleportservice that happened it would make this script enabled. Btw these are all local scripts. Not a single regular script. I know this is a lot to ask but could someone help me on this? I'm very confused. And without this i wont be able to make my game come to life. I would really appreciate some help :D

2 comments
What is your problem?
the problem is that when i beat the easy obby and it sends me back to the hub and i press on the medium obby. nothing happens the error still appears even tho the script is supposed to destroy it