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

5 comments
I would look at Object Browser. On line 07 .Hit is a property and not an event. That is why you are getting CFrame Errors because Hit deals with CFrames. Please look at object browser. Did you mean Button1Down? Happy scripting.
@LudeonDev thanks for the Help attempt. Ill Try to Fix this. I am Kind Of Bad Knowledge By MousePoint scriptting and stuff but yeah ill try
Hey dude, it is fine everybody stuggles just as long as you don't give up things will work out. I would really reccomend learning from AlvinBlox and TheDevKing, very good youtubers. Well, yea you are using a property and not an event. Happy scripting. All the best!
Try Target.Parent:FindFirstChild("Humanoid") not Target:FindFirstChild("Humanoid"). That is probably the problem.
@LudeonDev I watch Both of them and are in Devkings Discord server lol