So i want if it's a player you get the gui else not? I did this but it isn't working?
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local target = mouse.Target
local open = false
mouse.Button1Down:Connect(function()
if target and game.Players:FindFirstChild(target.Parent.Name) then
if open == false then
script.Parent.Main.Visible = true
script.Parent.FillTarget:FireServer(target)
elseif open == true and not target then
script.Parent.Main.Visible = false
open = false
elseif target and open == true then
script.Parent.FillTarget:FireServer(target)
end
end
end)

6 comments
You're not using RemoteEvents correctly. I'd suggest doing a little more research...
What i am doing bad the remoteEvents are good you don’t know what they need to do and i am talking about the GUI not about that
https://wiki.roblox.com/index.php?title=Remote_Functions_%26_Events Do a little more research one remove Event/Remote Functions
But what i do bad at remote events? That somehting else that don’t need to make the gui visible omg ... i only want that the gui comes not about any remote event
You should move the "target" variable inside the Button1Down event
I will try thanks u are better then the persons above u!