#Making an animation play when the player hit someone
73 messages · Page 1 of 1 (latest)
punch
oh can u show me ur script?
sure
ServerScriptService.UppercutServer:71: ServerScriptService.UppercutServer:9: attempt to index nil with 'Character'
also i got that error
dude
you can help me?
yea
is it in a local script?
like does ```rs.UppercutRemote.OnServerEvent:Connect(punch)
have a argument to pass to the function?
oh
maybe i need to make it the local player?
no no, since it needs the player argument
try to print "player"
ok
if its nil then that might be the problem
yup
that what was printed
thats why, so try to do this:
rs.UppercutRemote.OnServerEvent:Connect(function(player)
punch(player)
end)
ok
in which line i add it?
what line does the error occur?
9
oh this:
local character2 = player.Character or player.CharacterAdded:Wait()
how we change the player from nil
emm
if (char.PrimaryPart.Position - character.PrimaryPart.Position).Magnitude <= punchDistance then
coroutine.wrap(hit)(char, punchDamage)
break
end
line 62
and here too
for _, dummy in workspace.Dummies:GetChildren() do
if (dummy.PrimaryPart.Position - character.PrimaryPart.Position).Magnitude <= punchDistance then
coroutine.wrap(hit)(dummy, punchDamage)
break
end
end
@lost crypt