I posted something like this but it never worked so i decided to make a whole new script and now I need your help to make it work
local ReplicatedStorage = game:GetService('ReplicatedStorage')
local PunchEvent = ReplicatedStorage:WaitForChild('Punch')
PunchEvent.OnServerEvent:Connect(function(hi)
local ctr = hi.Character
local hum = ctr.Humanoid
local LeftArm = ctr:FindFirstChild("Left Arm")
local Power = hi.StatsFolder.StrengthValue.Value
LeftArm.Touched:Connect(function(PlayerWhoSent, HumanoidToDamage, Power)
print("touched")
if HumanoidToDamage.Parent and HumanoidToDamage.Parent.Humanoid then
HumanoidToDamage:TakeDamage(Power)
end
end)
end)
the error is attempt to index local 'HumanoidToDamage' (a nil value) this is a punch script and i have made another script for the punch animation in starter pack if needed then tell me. if i do print(HumanoidToDamage) it prints nil

1 comment
Touched event only has 1 parameter which is the PartThatTouched parameter