So i want if it's a player you get the gui else not? I did this but it isn't working?
01 | local player = game.Players.LocalPlayer |
02 | local mouse = player:GetMouse() |
03 | local target = mouse.Target |
04 | local open = false |
05 |
06 | mouse.Button 1 Down:Connect( function () |
07 | if target and game.Players:FindFirstChild(target.Parent.Name) then |
08 | if open = = false then |
09 | script.Parent.Main.Visible = true |
10 | script.Parent.FillTarget:FireServer(target) |
11 | elseif open = = true and not target then |
12 | script.Parent.Main.Visible = false |
13 | open = false |
14 | elseif target and open = = true then |
15 | script.Parent.FillTarget:FireServer(target) |
16 | end |
17 | end |
18 | 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