• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

CreatureScript problem - death

Lasomanos

New Member
Joined
Sep 25, 2009
Messages
56
Reaction score
1
Code:
function onDeath(cid, corpse, killer)
  registerCreatureEvent(cid, "crystalMines")
  local creaturename = getCreatureName(cid)
  if creaturename == 'Undead Crystal Miner' then
  doCreatureSay(cid, "asdasd", TALKTYPE_ORANGE_1)
  end
end

<script>
<event name="crystalMines" />
</script> --thats in monster file

<event type="death" name="crystalMines" script="crystalMines.lua"/> --creaturescripts.xml

this shutsdown my server with error: Segmentation fault in console
 
you have to register the [email protected]

LUA:
function onDeath(cid, corpse, killer)
    if getCreatureName(string.lower(cid)) == 'undead crystal miner' then
        doCreatureSay(cid, "asdasd", TALKTYPE_ORANGE_1)
    end
return true
end
try that one
 
Try using onKill instead. You also won't have to register it in monster file, but only in onLogin script.

what are the rules for registering? when yes when not? onLogin script means login.lua?

When I want to spawn teleport, do I have to register it? And registering in monster file mneas <scripts> ~~~~name~~~~ </script>?
 
onKill works, but only with the text.. when I add local to it or teleport, it stop working at all and says - unknown event name: crystalMines.. same with onDeath ;S

where to register it?? I pasted registerCreatureEvent(cid, "crystalMines") to login.lua and also to crystalMines.lua ;S halppp ;d
 
Code:
function onKill(cid, target, lastHit)
	if lastHit and getCreatureName(target):lower() == 'undead crystal miner' then
		doCreatureSay(cid, "Some text", TALKTYPE_ORANGE_1)
		doCreateTeleport(1387, teleportToPos, createAtPos)
	end
	return true
end
 
onKill works, but only with the text.. when I add local to it or teleport, it stop working at all and says - unknown event name: crystalMines.. same with onDeath ;S

where to register it?? I pasted registerCreatureEvent(cid, "crystalMines") to login.lua and also to crystalMines.lua ;S halppp ;d

return true before the last end :p
 
Back
Top