local ReplicatedStorage = game:GetService("ReplicatedStorage") local BulletEvent = ReplicatedStorage:WaitForChild("BulletEvent") BulletEvent.OnServerEvent:Connect(function(Player,Target,Hit) if Target.Parent:FindFirstChild("Humanoid") ~= false then Target.Parent.Humanoid:TakeDamage(15) end end)
returns " Players.XTOOTHLESX.Backpack.Tool.Script:4: attempt to index nil with 'Parent' "
Try this.
local ReplicatedStorage = game:GetService("ReplicatedStorage") local BulletEvent = ReplicatedStorage:WaitForChild("BulletEvent") BulletEvent.OnServerEvent:Connect(function(Player,Target,Hit) if Target.Parent:FindFirstChild("Humanoid") ~= nil then Target.Parent.Humanoid:TakeDamage(15) end end)