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?
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?