So im pretty noob at Lua so help plz :P
Problem:
ive got a button and im having it slide a menu with a bunch of buttons off the side of the screen.
here is my script
Invy = script.Parent.Parent.InvenButton Hide = script.Parent Armor = script.Parent.Parent.OpenArmor Stat = script.Parent.Parent.OpenStats Open =true function RunGui() if Open then Invy : TweenPosition(UDim2.new(.25, 0, .25, 0)) Hide : TweenPosition(UDim2.new(.25, 0, .25, 0)) Armor : TweenPosition(UDim2.new(.25, 0, .25, 0)) Stat : TweenPosition(UDim2.new(.25, 0, .25, 0)) end end script.Parent.MouseButton1Down:connect(RunGui)
Now this works perfect and it slides all the buttons to .25 like it says, but i have 2 buttons on there that are in a different Gui Group under StarterGui
These lines are whats causing the problem...idk if i did it completely wrong or if im missing 1 tiny thing hehe, here is the lines causing the problem.
BookOpen = script.Parent.Parent.Parent.ShopGui.Open BookClose = script.Parent.Parent.Parent.ShopGui.Close RockOpen = script.Parent.Parent.Parent.ShopGui.TextButton.Open RockClose = script.Parent.Parent.Parent.ShopGui.TextButton.Close BookOpen : TweenPosition(UDim2.new(.25, 0, .25, 0)) BookClose : TweenPosition(UDim2.new(.25, 0, .25, 0)) RockOpen : TweenPosition(UDim2.new(.25, 0, .25, 0)) RockClose : TweenPosition(UDim2.new(.25, 0, .25, 0))
So then i would have this but it doesnt work....
Invy = script.Parent.Parent.InvenButton --This is placed in StarterGui > HUD Hide = script.Parent --This is placed in StarterGui > HUD Armor = script.Parent.Parent.OpenArmor --This is placed in StarterGui > HUD Stat = script.Parent.Parent.OpenStats --This is placed in StarterGui > HUD BookOpen = script.Parent.Parent.Parent.ShopGui.Open --This is placed in StarterGui > ShopGui BookClose = script.Parent.Parent.Parent.ShopGui.Close --This is placed in StarterGui > ShopGui Hide = script.Parent RockOpen = script.Parent.Parent.Parent.ShopGui.TextButton.Open --This is placed in StarterGui > ShopGui RockClose = script.Parent.Parent.Parent.ShopGui.TextButton.Close --This is placed in StarterGui > ShopGui Open =true function RunGui() if Open then Invy : TweenPosition(UDim2.new(.25, 0, .25, 0)) Hide : TweenPosition(UDim2.new(.25, 0, .25, 0)) Armor : TweenPosition(UDim2.new(.25, 0, .25, 0)) Stat : TweenPosition(UDim2.new(.25, 0, .25, 0)) Hide : TweenPosition(UDim2.new(.25, 0, .25, 0)) BookOpen : TweenPosition(UDim2.new(.25, 0, .25, 0)) BookClose : TweenPosition(UDim2.new(.25, 0, .25, 0)) RockOpen : TweenPosition(UDim2.new(.25, 0, .25, 0)) RockClose : TweenPosition(UDim2.new(.25, 0, .25, 0)) end end script.Parent.MouseButton1Down:connect(RunGui)
Im not sure if this is even possible to tween Rock and Book since they are placed in different ScreenGuis, but if it is please help me get this sorted out......THANKS :)