So , i made a loading screen/intro and it works , but when i reset it shows again. How can i fix that?
My code :
local screen = math.random(1,3)
if screen == 1 then print '1' script.Parent.Parent.Parent.Parent.Enabled = true wait(2)
view source script.Parent:TweenSize(UDim2.new(.3, 1, 1), "Out", "Linear", 2, true) wait(2) script.Parent:TweenSize(UDim2.new(.5, 1, 1), "Out", "Linear", 1, true) wait(3) script.Parent:TweenSize(UDim2.new(1, 1, 1), "Out", "Linear", 1, true)
wait(1) script.Parent.Parent.Parent.Parent.Enabled = false wait(1) script.Parent:TweenSize(UDim2.new(0, 0, 0), "Out", "Linear", 1, true) end)
if screen == 2 then print '2' script.Parent.Parent.Parent.Parent.Enabled = true wait(2)
view source
script.Parent:TweenSize(UDim2.new(.1, 1, 1), "Out", "Linear", 3, true) wait(1) script.Parent:TweenSize(UDim2.new(.4, 1, 1), "Out", "Linear", 2, true) wait(4) script.Parent:TweenSize(UDim2.new(.7, 1, 1), "Out", "Linear", 3, true) wait(1) script.Parent:TweenSize(UDim2.new(1, 1, 1), "Out", "Linear", 1, true)
wait(1) script.Parent.Parent.Parent.Parent.Enabled = false wait(1) script.Parent:TweenSize(UDim2.new(0, 0, 0), "Out", "Linear", 1, true) end if screen == 3 then print '3' script.Parent.Parent.Parent.Parent.Enabled = true wait(2)
view source
script.Parent:TweenSize(UDim2.new(.6, 1, 1), "Out", "Linear", 2, true) wait(2) script.Parent:TweenSize(UDim2.new(.8, 1, 1), "Out", "Linear", 3, true) wait(3) script.Parent:TweenSize(UDim2.new(1, 1, 1), "Out", "Linear", 1, true)
wait(1) script.Parent.Parent.Parent.Parent.Enabled = false wait(1) script.Parent:TweenSize(UDim2.new(0, 0, 0), "Out", "Linear", 1, true) end)
script.Parent.Parent.Parent.Visible = false
About me
Hello, I am PrismaticFruits, a Roblox developer. I started scripting about 3 months ago. I have little experience on scripting but know a lot for such little experience.
Guide
In the instance ScreenGui
, there is a property in it called: ResetOnSpawn
. If you don't want it to reappear when the player dies, uncheck that property.
Conclusion
I hope this helped you and taught you a thing or two about GUI.
If this helped please accept this answer.
Goodluck,