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

Cannot communicate with other GUI's???

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?

3 comments

0

Is the button a parent of the frame?

0

Child

0

/\ Other account sorry

2 answers

✓ Accepted answer

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)

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

2 comments

0

That would be a comment. But solved now anyway.

0

the accepted answer is with playergui, so i answered first time right

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