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

more effective way to write this script?

Asked by 11 years ago
01frame = game.StarterGui.ScreenGui.Frame
02    function playerJoin()
03        wait(.5)
04        frame.Welcome.Visible = true
05        wait(.5)
06        frame.to.Visible = true
07        wait(.5)
08        frame.COR.Visible = true
09        wait(.5)
10        frame.Created.Visible = true
11        wait(1)
12        frame.Namelessassasin.Visible = true
13        frame.ImageName.Visible = true
14        frame.TheAncientVampire.Visible = true
15        frame.ImageVamp.Visible = true
16        wait(1)
17        frame.Play.Visible = true
18 
19    end
20    game.Players.PlayerAdded:connect(playerJoin)

im using this for my welcome gui to like wait a while before showing the next line, is there a more effective and cleaner way to write this script?

0
Done :P HexC3D 830 — 11y

1 answer

Log in to vote
2
Answered by
HexC3D 830 Moderation Voter
11 years ago
01  game.Players.PlayerAdded:connect(function(player)
02frame = player:WaitForDataReady(PlayerGui").ScreenGui.Frame -- Waits for the playergui until it's ready so the script does not break.
03z = frame:GetChildren() -- Get's children of z
04for i = 1,#z do -- for every number of children of the frame.
05if z[i].ClassName = "Frame" or "TextLabel" or "TextButton" then  -- If the Children of Frame is Frame or TextLabel Or a TextButton then
06z[i].Visible = true -- Make it visible
07wait(0.5) -- Waits half of a second
08end
09end
10 
11    end)

If this helped +1, also if answered your question check mark :)

0
can you explain this script, im still a beginner and its kind of hard for me to interpret this namelessassasin 30 — 11y
0
Mk. HexC3D 830 — 11y
0
what if i want the guis to go in a certain order, is it not possible or is there a way namelessassasin 30 — 11y
0
also, i tested my script(not yours) and it doesnt work, do you know why namelessassasin 30 — 11y
Ad

Answer this question