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

Textbutton to tween not functioning, help?

Asked by
unmiss 337 Moderation Voter
9 years ago

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
    • MenuGui
      • Mainframe
        • Menu (The header)
        • BailiffPanel (we're trying to tween "BailiffBase" with this button)

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.

0
Is it printing any of the "hit" or "my"? AmericanStripes 610 — 9y
0
No, I added those to try to troubleshoot the script but it does not print that unmiss 337 — 9y

1 answer

Log in to vote
0
Answered by
unmiss 337 Moderation Voter
9 years ago

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.

Ad

Answer this question