Im trying to make a gun shoot script, and this is what ive done so far:
(server script)
if hit:IsA('Humanoid') then
hit.Parent:FindFirstChild("Humanoid").Health = hit.Parent:FindFirstChild("Humanoid").Health - 10
end
hit is the object detected by the mouse.Target function in a seperate local script.
this works perfectly when i shoot a Basepart, but when i try shooting the sky, i get the error attempt to index nil with 'IsA'.
How do i fix this? all help is appreciated!