Got problem, cant access another GUI from a script, can someone help?
Asked by
5 years ago Edited 5 years ago
So uh i got a problem, roblox keeps telling me that there is error in line.
01 | local plr = game.Players.LocalPlayer |
02 | local object = script.Parent.Parent |
04 | local button = script.Parent |
07 | object.AnchorPoint = Vector 2. new( 0.5 , 0.5 ) |
08 | object.Position = UDim 2. new( 0.5 , 0 , 0.5 , 0 ) |
10 | local function onButtonActivated() |
11 | if toggle = = false then |
12 | object:TweenSize(UDim 2. new( 0 , 0 , 0 , 0 )) |
13 | script.Parent:TweenSize(UDim 2. new( 0 , 0 , 0 , 0 )) |
14 | Menu:TweenPosition(UDim 2. new( 0 , 0 , 0.887 , 0 )) |
16 | object.Visible = false |
17 | script.Parent.Visible = false |
25 | button.Activated:Connect(onButtonActivated) |
so i tried all the ways, script.Parent, but it always was saying "btn is not a valid member of PlayerGui" but if you look there musn't be any problems?
screenGUI named btn