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)
You're not getting any errors.
Your Target variable is set before you click. Set it when the player clicks instead of before.
I don't quite understand what you're trying to do here. Please contact me over Discord.
Bark#4260