Ad
Log in to vote
0

GUI Tweening, I need help?

Asked by 7 years ago

Script:

--Variables
local Player = game.Players.LocalPlayer
Menu = Player.PlayerGui.Menu
ZC = Player.PlayerGui.ZanpakutoCustomizer

Menu.ZanpakutoCustomizerButton.MouseButton1Down:connect(function()
    --Page1Tweening
    Menu.ZanpakutoCustomizerButton:TweenPosition(UDim2.new(1, 0, 0, 0), "In", "Quad", 2, false)
    Menu.GameNameLabel:TweenPosition(UDim2.new(1, 0, 0, 0), "In", "Quad", 2, false)
    Menu.GameVersionLabel:TweenPosition(UDim2.new(0.25, 0, 1, 0), "Out", "Quad", 2, false)
    Menu.WelcomeToLabel:TweenPosition(UDim2.new(0.25, 0, 1, 0), "Out", "Quad", 2, false)

    --Page2Tweening
    ZC.ZCBackground:TweenPosition(UDim2.new(1, 0, 1, 0), "In", "Quad", 2, false)

end)

Output:

zars15's CFrame loaded 00:33:53.444 - ZanpakutoCustomizer is not a valid member of PlayerGui 00:33:53.445 - Script 'Players.Player1.PlayerGui.Menu.ZanpakutoCustomizerButton.Pa', Line 4 00:33:53.446 - Stack End 00:34:56.270 - Auto-Saving...

I've been trying to find out the problem for hours...

0
It's a Valid member, but it's saying it's not... BosswalrusTheCoder 88 — 7y
0
The Output makes no sense... BosswalrusTheCoder 88 — 7y
0
IT WONT WORK FOR NO REASON! BosswalrusTheCoder 88 — 7y
0
SOMEONE ANSWER IM SPASSING! BosswalrusTheCoder 88 — 7y
View all comments (2 more)
0
Tweening only woks in local scripts now. Is it a local script? ultimate055 150 — 7y
0
Yes. BosswalrusTheCoder 88 — 7y

1 answer

Log in to vote
1
Answered by
Tuneable 100
7 years ago

First make sure you spelled everything correctly. Zanpakuto is a tricky word to spell

If that doesn't work, your issue is most likely that the script is running before the textbutton can load. To fix this, just use waitforchild.

ZC = Player.PlayerGui:WaitForChild("ZanpakutoCustomizer")

More info: http://wiki.roblox.com/index.php?title=WaitForChild

0
I now see. BosswalrusTheCoder 88 — 7y
Ad

Answer this question