juansanchez
Intermediate OT User
- Joined
- Apr 2, 2015
- Messages
- 217
- Reaction score
- 130
Hey guys, i have a problem with a script i found here in the forum made by @Xikini .
So basically what it does is, you kill a certain monster, when that monster dies, another spawns. I'm using it for a quest, where you need to kill the first boss and after that the actual boss spawns. I believe is similar to Zalomon on Wrath of the Emperror, but i'm not sure, i never did that quest.
I registered it on login.lua.
I added the script to the monster.xml, did everything right. However when i kill the monster nothing happens, no errors, doesn't spawn the second boss, nothing. I did try to use an onDeath function but whenever a player died on my server, anywhere on the map, the boss would spawn next to the player and stay there.
This is the one i tried using:
Can anyone help me? Maybe tell me what i did wrong?
I'm using TFS 0.3.6
Code:
[LIST=1]
[*]local creatureName = 'cave rat' -- creaturename (must be lowercase letters)
[*]local newCreature = 'rat'
[*]local creatureSay = 'I am saying something'
[*]
[*]function onKill(cid, target, damage, flags)
[*] if isPlayer(target) then
[*] return false
[*] end
[*] local name = getCreatureName(target):lower()
[*] if name ~= creatureName then
[*] return false
[*] end
[*] local position = getCreaturePosition(target)
[*]
[*] -- player says something
[*] -- doCreatureSay(cid, ''.. creatureSay ..'', TALKTYPE_ORANGE_1)
[*]
[*] -- creature says something
[*] doCreatureSay(cid, ''.. creatureSay ..'', TALKTYPE_ORANGE_1, false, 0, position)
[*]
[*] -- create monster near the corpse (no delay)
[*] doCreateMonster(newCreature, position)
[*]
[*] -- create monster on the corpse (very small delay, that may or may not be noticeable to the player, however is noticeable with god on local connection)
[*] -- addEvent(doCreateMonster, 0, newCreature, position)
[*] return true
[*]end
[/LIST]
So basically what it does is, you kill a certain monster, when that monster dies, another spawns. I'm using it for a quest, where you need to kill the first boss and after that the actual boss spawns. I believe is similar to Zalomon on Wrath of the Emperror, but i'm not sure, i never did that quest.
I registered it on login.lua.
I added the script to the monster.xml, did everything right. However when i kill the monster nothing happens, no errors, doesn't spawn the second boss, nothing. I did try to use an onDeath function but whenever a player died on my server, anywhere on the map, the boss would spawn next to the player and stay there.
This is the one i tried using:
Code:
function onDeath(cid)
doSendMagicEffect(getThingPos(cid), 36)
return doCreateMonster('Satan', getThingPos(cid))
end
Can anyone help me? Maybe tell me what i did wrong?
I'm using TFS 0.3.6