I want a GUI to disappear just when the player enters. I even gave the script a 2 second wait, so it can load, but the Button doesn't disappear. In Studio, it works fine, but in the Player it bugs
Here's the entire script
local Player = game.Players.LocalPlayer
local LoadScreen = script.Parent.Parent.Parent.Parent.LoadScreen.Frame
local Center = script.Parent.Parent
local BlackScreen = Center.Parent.BlackScreen
local Button = script.Parent
wait(2)
Button.Transparency = 1
BlackScreen.Transparency = 1
Center.Visible = false
local Spawned = Player:FindFirstChild("Spawned")
repeat
wait(.1)
until
LoadScreen.Visible == false
wait(.1)
Center.Visible = true
for i = 1, 40 do
Button.Transparency = Button.Transparency - 0.025
wait(.01)
end
wait(.1)
local Debounce = false
script.Parent.MouseButton1Down:connect(function()
if Debounce == false then
Debounce = true
wait(.1)
for i = 1, 40 do
Button.Transparency = Button.Transparency + 0.025
wait(.01)
end
for i = 1, 40 do
BlackScreen.Transparency = BlackScreen.Transparency - 0.025
wait(.01)
end
wait(.5)
local Target = CFrame.new(0, 5, 0)
if Player.Character and Player.Character.Torso then
Player.Character.Torso.CFrame = Target
end
Spawned.Value = true
for i = 1, 40 do
BlackScreen.Transparency = BlackScreen.Transparency + 0.025
wait(.01)
end
end
end)

1 comment
UGH... Too long. You didn't explain it well enough.