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

Gui does not close in multi player mode?

I was testing my game in solo mode and it was working perfectly, but when a friend tested it in multi player mode the gui would not close a am a little confused. here is the code: (Note it has been edited, but it still does not work)

local mainFrame = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame
local scrollFrame = game.Players.LocalPlayer.PlayerGui.ScreenGui.ScrollingFrame
local closeScreen = game.Players.LocalPlayer.PlayerGui.ScreenGui.Frame.closeScreen


function closeGUI()
	
	mainFrame.Visible = false 	--when these are closed everything inside it will close
	scrollFrame.Visible = false
			
end

closeScreen.MouseButton1Click:connect(closeGUI)

1 answer

What is script.Parent.Parent.Parent.Frame and all that? Also is this in a localscript or a server script.

3 comments

0

that was how I was connecting to frame, but I should of did "script.Parent.Parent" and so on and it is a local script

0

I would say instead of all this "script.Parent" business just use game.Players.LocalPlayer.PlayerGui.Frame;

0

It still is not working

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