Hiya! I have an issue.. again.
I want to get the players specific summon (It needs to be a specific summon as im using this as a summoner/pet system and you can have several "summons")in a onKill script in creaturescripts, how do i do that? And check that it returns correct?
Here's the script so far, I got stuck at the "player:" as you can see. Its not done either so no harass about the code itself please. x)
Edit: Using tfs 1.3
I want to get the players specific summon (It needs to be a specific summon as im using this as a summoner/pet system and you can have several "summons")in a onKill script in creaturescripts, how do i do that? And check that it returns correct?
Here's the script so far, I got stuck at the "player:" as you can see. Its not done either so no harass about the code itself please. x)
Lua:
function onKill(player, target)
local monster = Monster(target)
if monster and monster:getMonsterLevel() > 0 then
monsterLevel = monster:getMonsterLevel()
calculation = monsterLevel/10
prePetLevel = player:setStorageValue(99999, (player:getStorageValue(99999) + calculation)) -- Calculate the storage aka pre-level recieved on kill.
local petLevelupConfig = {10, 40, 100, 200, 350, 500, 1000}
local summon = player:
for i = 1,#petLevelupConfig do
if prePetLevel == petLevelupConfig[i] then
summon:setLevel(summon:getMonsterLevel() + 1)
end
end
end
end
Edit: Using tfs 1.3