Hello,
im new here
im using theForgottenServer0.3.6 and i have a Problem with the onDeath function:
I've created some checks for the Paramete Values:
But in the Result are Some Issues:
1. MostDamageKiller = nil
2. Position is a Table
Position ServerLog:
FullServerLog:
If I try to fix the Position by adding an Index:
I'm getting this Result:
Why i cant access Position?
Why is MostDamageKiller nil?`
Would be great if anyone can help me with this or
discribe whats exactly in Tables mostDamageKiller, position and in parameter corpse
Thanks
im new here
im using theForgottenServer0.3.6 and i have a Problem with the onDeath function:
I've created some checks for the Paramete Values:
Code:
function onDeath(creature, corpse, killer, mostDamageKiller, unjustified, mostDamageUnjustified)
local cid = creature
print("------PARAMETER CHECK------.")
-- Print killer isPlayer ?
if isPlayer(killer[1]) then
print("Killer is a player.")
end
-- Print CID id Player or Creature?
if isPlayer(cid) then
print("cid is Player")
elseif not isPlayer(cid) and isCreature(cid) then
print("cid ist Creature")
end
-- Print mostDamageKiller is Player?
if isPlayer(mostDamageKiller) then
print("MostDamageKiller ist Player")
end
-- Print CID
if cid ~= nil then
print("creature Value: "..cid..".")
end
-- Print CreatureCorpse
if corpse ~= nil then
print("CorpseContent: "..corpse.itemid..".")
end
-- Print MostDamageKiller Value
if(mostDamageKiller ~= nil) then
print("MostDamageKiller Value:"..mostDamageKiller..".")
end
-- Print CreatureName
local creaturename = getCreatureName(cid)
if creaturename ~= nil then
print("CreatureName: "..creaturename..".")
end
-- Print Position of Creature
local position = getCreaturePosition(cid)
if position ~= nil then
print("Position: "..position..".")
end
print("------PARAMETER CHECK END------.")
But in the Result are Some Issues:
1. MostDamageKiller = nil
2. Position is a Table
Position ServerLog:
Code:
[27/10/2018 15:39:17] Description:
[27/10/2018 15:39:17] data/creaturescripts/scripts/inquisitionPortals.lua:105: attempt to concatenate local 'position' (a table value)
[27/10/2018 15:39:17] stack traceback:
[27/10/2018 15:39:17] data/creaturescripts/scripts/inquisitionPortals.lua:105: in function <data/creaturescripts/scripts/inquisitionPortals.lua:57>
FullServerLog:
Code:
[27/10/2018 15:39:17] ------PARAMETER CHECK------.
[27/10/2018 15:39:17] Killer is a player.
[27/10/2018 15:39:17] cid is Creature
[27/10/2018 15:39:17] creature Value: 1073764678.
[27/10/2018 15:39:17] CorpseContent: 6336.
[27/10/2018 15:39:17] CreatureName: Juggernaut.
[27/10/2018 15:39:17] [Error - CreatureScript Interface]
[27/10/2018 15:39:17] data/creaturescripts/scripts/inquisitionPortals.lua:onDeath
[27/10/2018 15:39:17] Description:
[27/10/2018 15:39:17] data/creaturescripts/scripts/inquisitionPortals.lua:105: attempt to concatenate local 'position' (a table value)
[27/10/2018 15:39:17] stack traceback:
[27/10/2018 15:39:17] data/creaturescripts/scripts/inquisitionPortals.lua:105: in function <data/creaturescripts/scripts/inquisitionPortals.lua:57>
If I try to fix the Position by adding an Index:
Code:
-- Print Position of Creature
local position = getCreaturePosition(cid)
if position ~= nil then
print("Position: "..position[1]..".")
end
I'm getting this Result:
Code:
[27/10/2018 15:53:54] ------PARAMETER CHECK------.
[27/10/2018 15:53:54] Killer is a player.
[27/10/2018 15:53:54] cid ist Creature
[27/10/2018 15:53:54] Creature Value: 1073764674.
[27/10/2018 15:53:54] CorpseContent: 6336.
[27/10/2018 15:53:54] CreatureName: Juggernaut.
[27/10/2018 15:53:54] [Error - CreatureScript Interface]
[27/10/2018 15:53:54] data/creaturescripts/scripts/inquisitionPortals.lua:onDeath
[27/10/2018 15:53:54] Description:
[27/10/2018 15:53:54] data/creaturescripts/scripts/inquisitionPortals.lua:109: attempt to concatenate field '?' (a nil value)
[27/10/2018 15:53:54] stack traceback:
[27/10/2018 15:53:54] data/creaturescripts/scripts/inquisitionPortals.lua:109: in function <data/creaturescripts/scripts/inquisitionPortals.lua:57>
Why i cant access Position?
Why is MostDamageKiller nil?`
Would be great if anyone can help me with this or
discribe whats exactly in Tables mostDamageKiller, position and in parameter corpse
Thanks
Last edited: