• 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!

[Help] What's wrong with this script?

furstwin

Member
Joined
Aug 9, 2007
Messages
511
Reaction score
15
Location
Sweden
Marcinek Paladinek~ made a Monster killing quest, as radonia has.

Whats wrong with this code?
Creaturescripts.xml
Code:
	<event type="death" name="TrollQuest" script="trollquest.lua"/>
Login.lua:
Code:
	registerCreatureEvent(cid, "TrollQuest")
Trollquest.lua
Code:
function onPrepareDeath(cid, killer)
    TROLL_QUEST = getPlayerStorageValue(cid, 9876)
    if getCreatureName(cid) == "Troll" then
        if TROLL_QUEST ~= 0 and TROLL_QUEST < 5 then
            setPlayerStorageValue(cid, 9876, TROLL_QUEST + 1)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have killed: "..TROLL_QUEST.."/5.")
        elseif TROLL_QUEST == 5 then
            doPlayerSendTextMessage(cid, 22, "Congratulations, you are done!")
            setPlayerStorageValue(cid, 9875, 1)
        end
    end
return TRUE
end

Sincerely,
Furstwin.
 
Last edited:
Code:
    <event type="death" name="TrollQuest" script="trollquest.lua"/>
should be
Code:
    <event type="onDeath" name="TrollQuest" script="trollquest.lua"/>

I think, not sure tho... xD
 
Nah, its "death", but, yeah, Ive made one, that doesnt work, I just posted a layout in some thread how it should look like.

I guess it should be done with onKill tho, Ill maybe try to do one tomorrow :P
 
Back
Top