Hi. So I made a GUI that you click(TextButton)Once you click it, if 3 ceartin GUIs are not on the screen, the script uses the function TweenPosition
to get the 3 GUIs on the screen. Otherwise, the script uses the same function, TweenPosition
, to get the GUIs off the screen.
What happens is when the 3 GUIs are hidden and the button is clicked, two of the GUIs correspond normally, but the third one doesnt. Here is the error output gave me.
TweenPosition is not a valid member of TextLabel
I thought this meant i put a period behind TweenPosition
instead but i put a colon like i was supposed to. Check it out, line 14.
local debounce = true local showing = false local hidden = true local colorbox = script.Parent.Parent:WaitForChild("Color") local material = script.Parent.Parent:WaitForChild("Material") local shape = script.Parent.Parent:WaitForChild("Shape") script.Parent.MouseButton1Click:connect(function() if debounce and hidden and showing == false then debounce = false colorbox:TweenPosition(UDim2.new(0.27, 0, 0.6, 0), "Out", 1) wait(0.5) material:TweenPosition(UDim2.new(0.27, 0, 0.27, 0), "Out", 1) wait(0.5) shape:TweenPositon(UDim2.new(0.04, 0, 0.27, 0), "Out", 1)--right here. What's wrong? hidden = false showing = true debounce = true elseif debounce and showing and hidden == false then debounce = false shape:TweenPosition(UDim2.new(0.04, 0, -1, 0), "Out", 1) wait(0.5) material:TweenPosition(UDim2.new(0.04, 0, -1, 0), "Out", 1) wait(0.5) colorbox:TweenPosition(UDim2.new(0.27, 0, -1, 0), "Out", 1) hidden = true showing = false debounce = true end end)
As you can see, I put a colon. What's Wrong? Also if you could please check for any other errors so I don't have to ask another question. Thanks!
Solution
I would normally put an explanation, but you've done what we've all once done. A syntax spelling mistake. Your mind automatically corrected it while writing out that error (WOAH TECHNOLOGY), giving me a hard time realising what you have done. It's simple. Just replace line 14 with:
shape:TweenPosition(UDim2.new(0.04, 0, 0.27, 0), "Out", 1)