I am making a script where when you click it, it should tp you to another game. Thats covered but my function is not working. I made a function supposed to make all the GUI’s invisible, but its not working. Why?
local clicked = false
local function BeginCollectingSequence()
local startergui = game.StarterGui
startergui.Shop.Enabled = false
startergui.TPMenu.Close.Visible = false
startergui.TPMenu.Open.Visible = false
startergui.TPMenu.MenuFrame.Visible = false
startergui.Tutorial.Enabled = false
end
local TeleportService = game:GetService("TeleportService")
local GameId = 5356825192
local object = script.Parent.Parent.Parent.Blackout
object.AnchorPoint = Vector2.new(0,0)
object.Position = UDim2.new(1, 0, 0, 0)
object.Visible = true
script.Parent.MouseButton1Down:Connect(function()
wait(1)
BeginCollectingSequence()
object.BackgroundTransparency = 0
object:TweenPosition(UDim2.new(0,0,0,0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce)
wait(0.5)
TeleportService:Teleport(GameId)
end)
All help appreciated