if killReason == HARM_TYPE_JUMP and "variable from onTickNPC" then
in function onNPCHarm and didn't work. Is there a way to connect a function to function like connecting function onTickNPC to onNPCHarm for their variables?
local gvar = ...
function onTickNPC(v)
gvar = ...
end
function onNPCHarm(token, killedNPC, killReason)
if (killReason == HARM_TYPE_JUMP and gvar == ...) then
...
end
end
It sounds more likely that you want to use the NPC's data table, rather than a script-wide variable. Script-wide variables only store one value, so it will be the same across all NPCs. However, NPC data tables (accessed via myNPC.data.myVar) allow you to store values for each NPC, which seems more likely to be what you want.