I need a quick few tips on how to get a Humanoid when the Mouse Cursor is pointed at the Model as you point at the Zombie (model) and it shows the GUI of the HP of that zombie.
All I need right now is to get the Humanoid from Pointing the mouse at the model. I've never used something like that in scripts.
This is what I've done so far:
wait(0.5)
local char = game:GetService("Players").LocalPlayer.Character -- I need to make this variable to change to the Model Humanoid EVERYTIME you point at the "Zombie".
local hum = char.Humanoid
hum.Changed:Connect(function()
script.Parent.Frame.Health.Frame.Size = UDim2.new(hum.Health / hum.MaxHealth, 0, 1, 0)
script.Parent.Frame.Text.TextLabel.Text = math.floor(hum.Health) .. "/" .. hum.MaxHealth
if hum.Health <= hum.MaxHealth * 0.15 then
script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(150 / 255, 0, 0)
else
script.Parent.Frame.Health.Frame.BackgroundColor3 = Color3.new(0, 220 / 255, 0)
end
end)

3 comments
Just make a script that you will instance a part and the part is invisible which the part follows your cursor and add a script wherein the part senses the model in touch.
use mouse.Target and the mouse.Move event
i mean you could do what expodo134ALT said but you could use renderstepped instead of mouse.Move