Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Textbutton to tween not functioning, help?

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.

2 comments

0

Is it printing any of the "hit" or "my"?

0

No, I added those to try to troubleshoot the script but it does not print that

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.