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

Cannot communicate with other GUI's???

Asked by 4 years ago

Well, I am having an issue where none of my LocalScripts are communicating with another GUI. So, I have ScreenGUI in StarterGUI, with a frame and button inside it, the button needs to open the frame. I have this LocalScript in the button:

script.Parent.MouseButton1Down:Connect(function(OpenGUI)
       game.StarterGui.ScreenGui.Frame:TweenPosition(UDim2.new(0,0.299,0,0.299), 'Out', 'Back', 0.5)
script.Parent.Visible = false
end)

But all it does is goes invisible and doesn't tween the other frame?

So then, I changed the tween to make the frame AND button hide, but still only the button hides.

Any help?

0
Is the button a parent of the frame? RyanTheLion911 195 — 4y
0
Child Insentery 0 — 4y
0
/\ Other account sorry Sk3pticalR0BL0X 33 — 4y

2 answers

Log in to vote
1
Answered by
starmaq 1290 Moderation Voter
4 years ago

Ok so, once the game starts, all the objects in game.StarterGUI get copied to the player object found within game.Players, and more precisly in game.Players.LocalPlayer.PlayerGUI. Think of game.Players.LocalPlayer as the player, and inside of him he has PlayerGUI which is where guis from StarterGUI are being copied to. You're tweening the frame that's in startergui which won't work out. This is why the frame isn't being tweened but the other frame is becoming invisible, the frame that goes invisible is working fine because he's the parent of the script, and you're doing script.Parent so all good. But for the other frame it's not good, so what we have to do is change the refrence for the tweening frame.

local player = game.Players.LocalPlayer --since we are using the localplayer this has to be a local script
local frame = player.PlayerGui.ScreenGui.Frame --this is the actual frame, there might be another way of finding it depends on how you set it up

script.Parent.MouseButton1Down:Connect(function(OpenGUI)
       frame:TweenPosition(UDim2.new(0,0.299,0,0.299), 'Out',        
       'Back', 0.5)
script.Parent.Visible = false
end)
Ad
Log in to vote
0
Answered by
gloveshun 119
4 years ago

Sometimes the script changes in startergui not works, did you tried to edit the Plaergui?

0
That would be a comment. But solved now anyway. Sk3pticalR0BL0X 33 — 4y
0
the accepted answer is with playergui, so i answered first time right gloveshun 119 — 4y

Answer this question