You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? I’m trying to make a menu where you choose between 2 teams, you get to a play menu, then you select a class, and then you spawn.
What is the issue? The issue is the loading screen I use to transition from screen to screen won’t go away, even after setting its frame visibility to false.
What solutions have you tried so far? Friends, devhub, scriptinghelpers.
ui.MainPlayFrame.Play.MouseButton1Click:Connect(function()
ui.LoadingScreen.Visible = true
if value.Value == "noteam" then
print("Player has no team!")
elseif value.Value == "DE" then
print("DE")
ui.ClassSelect2.Visible = true
elseif value.Value == "UK" then
print("UK")
ui.ClassSelect1.Visible = true
else print("Huh")
ui.LoadingScreen.Loading:TweenPosition(
UDim2.new(0.3, -3,0.2, 0),
Enum.EasingDirection.In,
Enum.EasingStyle.Elastic,
4,
false,
invis
)
ui.MainPlayFrame.Visible = false
end
end)
The invis() function:
function invis()
ui.LoadingScreen.Visible = false
end
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
If the loading screen is one time thing cant you do ui.LoadingScreen:Destroy?? or am I not understanding you correctly? if you can, can you post an image or gif of the issue the issue is not understood exactly, is the loadingscreen interfering with button pressing for team changing or?
Hey. Since UI in the StarterGui is replicated to the client when the game starts, it’s best you make your variable pointing towards the player’s GUI.
If the localscript you are using is inside the GUI, it might be best to make this your variable: local ui = script.Parent
However, if it is placed differently it is best to make your variable as such: local ui = game:GetService("Players").LocalPlayer.PlayerGui.UI
If you’d like a more fancy approach to your function as well with the invisibility, it’d also be quite optimal to use TweenService (which is optional)
local TweenService = game:GetService("TweenService")
TweenService:Create(ui.LoadingScreen, TweenInfo.new(0.5), {Transparency = 1}):Play()