Hi, I'm trying to make a mob/npc/creature/whatever you want to call it targeting system, basically when you click on something that has the target circle as a child, it the circle would become visible and when you click away from the thing or clicked on another thing that had a target circle as a child it would switch to that one.
I've tried to attempt this by myself but after countless tears of rage have been shed I decided that maybe I should stop metaphorically bashing my head against a wall and ask for help.
---This is my attempt---- don't laugh at me...
----------------------------------------------------------------------
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local function target()
if Mouse.Target.Parent:FindFirstChild("Target") then
Mouse.Target.Parent:FindFirstChild("Target").Transparency = 0
return Mouse.Target.Parent:FindFirstChild("Target")
end
end
local function untarget()
local targeted = target()
if targeted == nil then
Mouse.Target.Parent:FindFirstChild("Target").Transparency = 1
end
end
Mouse.Button1Down:Connect(untarget)
----------------------------------------------------------------------

1 comment
Thanks for the help man! Works like a charm.