Mouse.Target returns the player?
Asked by
5 years ago Edited 5 years ago
So I'm trying to make a point-and-click type of weapon, and I use a RemoteEvent so it registers on the server, and in output, it returns " 19:07:25.915 - Humanoid is not a valid member of Player"
02 | local player = game.Players.LocalPlayer |
03 | local character = player.Character |
05 | script.Parent.Equipped:Connect( function (mouse) |
06 | mouse.Button 1 Down:Connect( function () |
07 | if mouse.Target.Parent:FindFirstChild( "Humanoid" ) then |
08 | script.Parent.Attack:FireServer(mouse.Target.Parent) |
13 | local tool = script.Parent |
14 | local event = tool.Attack |
16 | event.OnServerEvent:Connect( function (target) |
17 | target.Humanoid.Health = 0 |