To be honest, this worked before until I changed my GUI system to have a bunch of different ScreenGUIs rather than Frames in one big screengui.
I thought it was the hierarchy that was making it break, but clearly not. This is utterly confusing. I don't get it.
Code:
local black = false
function nope123n()
if black == false then
print("my")
script.Parent:TweenPosition(UDim2.new(0.5, -120,0.5, -125), "In", "Linear", 1)
wait(0.1)
black = true
script.Parent.Parent.BailiffPanel.Text = "Close Panel"
elseif black == true then
print("hit")
script.Parent:TweenPosition(UDim2.new(0.5, -120,0.5, -825), "Out", "Linear", 1)
black = false
script.Parent.Parent.BailiffPanel.Text = "Bailiff Panel"
end
end
script.Parent.Parent.Parent.MenuGui.Mainframe.BailiffPanel.MouseButton1Click:connect(nope123n)
Hierarchy (needed):
- StarterGui
- BailiffGui
- BailiffBase (we're trying to tween this frame with the "BailiffPanel" button)
- Aforementioned "LocalScript" (making this happen)
- other stuff u dont need to worry about
- BailiffBase (we're trying to tween this frame with the "BailiffPanel" button)
- MenuGui
- Mainframe
- Menu (The header)
- BailiffPanel (we're trying to tween "BailiffBase" with this button)
- Mainframe
- BailiffGui
GIF:
http://i.imgur.com/heUoH1V.gif
This is pretty confusing, I hope you guys can help!
edit: I fixed it, lines #9 and #14 were not formatted to the correct hierarchy and somehow the computer didn't manage to get to that line.

2 comments
Is it printing any of the "hit" or "my"?
No, I added those to try to troubleshoot the script but it does not print that