Code Looks Fine, but Nothing happens
Posted: Fri Jan 08, 2021 3:18 pm
So, I'm finally trying to code my own NPC, though unfortunatly, I can't seem to find the error here:
After being jumped on or hit with Sword the NPC should transform to a faster version of itself, so as a PH, I just went
with NPC-1 for the start, so instead of transforming, it just dies. The SFX also isen't working.

Any help would be apperiated.
Code: Select all
function bulbulNPC.onNPCHarm(eventObj, v, killReason, culprit)
if v.id ~= npcID then return end
if killReason ~= HARM_TYPE_JUMP and killReason ~= HARM_TYPE_SWORD then return end
v:transform(1)
SFX.play(82)
eventObj.cancelled = true
--if killReason == HARM_TYPE_ PROJECTILE_USED or killReason == HARM_TYPE_SPINJUMP then return end
end
with NPC-1 for the start, so instead of transforming, it just dies. The SFX also isen't working.

Any help would be apperiated.