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

Why does my Gui script work with "Run" but not with "Play"?

Asked by 8 years ago

I finally managed to make the script work, but for some reason it won't work in "Play", I've tried with the PlayerAdded function, but it dosen't work either way.

Here is the script I used, which managed to work. (In "Run")

sizeIntroP1 = 0

    while ( sizeIntroP1 < 300 ) do

        game.StarterGui.intro.introP1.Size = UDim2.new(1, 0, 0, sizeIntroP1)

        sizeIntroP1 = sizeIntroP1 + 1
        wait(0.01)
end

1 answer

Log in to vote
1
Answered by
TopDev 0
8 years ago

UPDATED

p = game.Players.LocalPlayer
sizeIntroP1 = 0
p:WaitForChild("PlayerGui")
p.PlayerGui:WaitForChild("intro")
p.PlayerGui.intro:WaitForChild("introP1")

    while ( sizeIntroP1 < 300 ) do

        p.PlayerGui.intro.introP1.Size = UDim2.new(1, 0, 0, sizeIntroP1)

        sizeIntroP1 = sizeIntroP1 + 1
        wait(0.01)
end

Ad

Answer this question