• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Creature dies other respawns

something like this maybe?

add this onKill creatureEvent to players
Code:
function onKill(cid, target, lastHit)
   if isMonster(target) then
      doCreateMonster(getCreatureName(target), getCreaturePosition(target))
   end
   return true
end
 
where I wrote getCreatureName(target) just change the name to the creature u want to appear :)

dun forget to Rep if I help :)

Code:
local respawnMonster = "Ghost" --Change monster here

function onKill(cid, target, lastHit)
   if isMonster(target) then
      doCreateMonster(respawnMonster, getCreaturePosition(target))
   end
   return true
end
 
Well, not worked yet. Maybe I did something wrong?
tag creaturescripts.xml
<event type="kill" name="snake god essence" event="script" value="snake god essence.lua"/>
snake god essence.lua:

local respawnMonster = "Snake Thing" --Change monster here

function onKill(cid, target, lastHit)
local target = "Snake God Essence"
if isMonster(target) then
doCreateMonster(respawnMonster, getCreaturePosition(target))
end
return true
end
I tried with and without the red thing. And still not working :<

I won't forget to rep++ if you can help me!

EDIT: No console errors x.x
 
on creaturescripts.xml
Code:
<event type="kill" name="SnakeGodEssence" event="script" value="SnakeGodEssence.lua"/>
I don't use spaces because I don't like to, personal taste only


on SnakeGodEssence.lua write
Code:
local respawnMonster = "Snake Thing" --Change monster here

function onKill(cid, target, lastHit) --The target comes from the onKill function itself, no need to set it yourself
   if isMonster(target) then
      doCreateMonster(respawnMonster, getCreaturePosition(target))
   end
   return true
end

on your login.lua
Code:
function onLogin(cid)
   ...
   registerCreatureEvent(cid, "SnakeGodEssence")
   ...
end

you have to register the new event so that when the players kill, the servers runs that script, if you don't register it, its like its not even there

This should work :)
 
Back
Top