Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

{Solved by Asker} Loading screen shows after player resets?

Asked by 4 years ago
Edited 4 years ago

I have this loading screen code here:


local plr = game.Players.LocalPlayer local ts = game:GetService("TweenService") game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui'):SetTopbarTransparency(1) IgnoreGuiInset = true local overlay = script.Parent.ScrollingFrame wait() ts:Create(overlay,TweenInfo.new(.5,Enum.EasingStyle.Quint),{Size = UDim2.new(1,0,.2,0)}):Play() wait(2.5) repeat wait() until plr.Character ts:Create(overlay,TweenInfo.new(.9,Enum.EasingStyle.Quint),{Size = UDim2.new(1,0,.35,0)}):Play() wait(1) repeat wait() until workspace repeat wait() until game.Players ts:Create(overlay,TweenInfo.new(.16,Enum.EasingStyle.Quint),{Size = UDim2.new(1,0,.6,0)}):Play() wait(1) repeat wait() until game:GetService("DataStoreService") ts:Create(overlay,TweenInfo.new(.32,Enum.EasingStyle.Quint),{Size = UDim2.new(1,0,.8,0)}):Play() wait(1) repeat wait() until game:GetService("Lighting") repeat wait() until game:GetService("GamePassService") repeat wait() until game:GetService("MarketplaceService") ts:Create(overlay,TweenInfo.new(.5,Enum.EasingStyle.Quint),{Size = UDim2.new(1,0,.91,0)}):Play() wait(2) --ts:Create(script.Parent.Checkmark,TweenInfo.new(.32,Enum.EasingStyle.Linear),{Size = UDim2.new(1,0,.8,0)}):Play() ts:Create(script.Parent,TweenInfo.new(2.5,Enum.EasingStyle.Elastic),{Position = UDim2.new(0,0,1.15,0)}):Play() script:Destroy()

The loading screen its self is working perfectly fine, but the problem is that when a player resets, the loading screen shows again.

I don't want it showing again, so I added a script:Destroy() at the end, but it isn't working.

How do I fix this problem?

Any help is appreciated.

1 answer

Log in to vote
0
Answered by
RAFA1608 543 Moderation Voter
4 years ago
Edited 4 years ago

Try destroying the Gui locally in the StarterGui folder. So, instead of destroying the script (which doesnt have to do anything with the gui itself), destroy the gui in the startergui folder locally. The code shall be something like this:

--in the same localscript as the code you made
local startergui = game.StarterGui
local myclone = startergui:FindFirstChild(script.Parent.Name) --adjust this as you need to
if myclone ~= nil then
    myclone:Destroy()
else
    print("Something went wrong.")
end

This shall do (i guess)

0
The Loading screen still shows after I reset :/ JealousRegretHate 34 — 4y
0
Hmm... Wait for another answer then. I have no idea. RAFA1608 543 — 4y
Ad

Answer this question