So I am Working On A gun And right Now I Need it to Find Humanoid Player When Clicking On It.
heres my script:
local mouse = game.Players.LocalPlayer:GetMouse() -- mouse local Handle = script.Parent.Handle local Gun = script.Parent local ShootSound = script.Parent.Handle.Shoot Gun.Activated:Connect(function() -- Activates the gun (Mouse Clicked While Equip) mouse.Hit:Connect(function(Target) if Target:FindFirstChild("Humanoid") then game.Players.LocalPlayer.Character.Humanoid:TakeDamage(10) ShootSound:Play() -- This is a Gun Shoot Sound else ShootSound:Play() print("Target Not Humanoid") end end) end)
The Thing is that At It dont show what line it is and It Gives a error that says (Connect is Not A vaild member of CFrame ) And I never Took CFrame on the Line.
Anyone? Help
Try Target.Parent:FindFirstChild("Humanoid") not Target:FindFirstChild("Humanoid"). That is probably the problem.