• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent [CreatureEvent/Npc] Killing in the name of... [Now player can choose the task]

Its dosent matter where in monster file i will paste this script? Bcs i paste it and it dosent work
<script>
<event name="KillingInTheNameOf"/>
</script>
 
Its dosent matter where in monster file i will paste this script? Bcs i paste it and it dosent work
<script>
<event name="KillingInTheNameOf"/>
</script>

Hi, I'm using tfs 1.4.2 and I solve this by changing creaturescripts/killinginthenameof.lua to scripts/creaturescripts/killinginthenameof.lua

my code from scripts/creaturescripts/killinginthenameof.lua is:
LUA:
local questCreatures =
{
    ["dragon"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15000, killsRequired = 500, raceName = "Dragons"},
    ["dragon lord"] = {questStarted = 1510, questStorage = 65000, creatureStorage = 15001, killsRequired = 500, raceName = "Dragons"},   
    ["hydra"] = {questStarted = 1511, questStorage = 65001, creatureStorage = 15002, killsRequired = 1500, raceName = "Hydras"},   
    ["yielothax"] = {questStarted = 1512, questStorage = 65002, creatureStorage = 15003, killsRequired = 1500, raceName = "Yielothax"},   
    ["grim reaper"] = {questStarted = 1513, questStorage = 65003, creatureStorage = 15004, killsRequired = 6000, raceName = "Grim Reaper"},
    ["demon"] = {questStarted = 1514, questStorage = 65004, creatureStorage = 15005, killsRequired = 6666, raceName = "Demons"}
}
 
local msgType = MESSAGE_STATUS_CONSOLE_ORANGE


local creatureevent = CreatureEvent("KillingInTheNameOf")


function creatureevent.onKill(cid, target, lastHit)
 
    local creature = questCreatures[getCreatureName(target):lower()]   
    if creature.raceName then
        if isPlayer(target) or isSummon(target) then return true end
        if getCreatureStorage(cid, creature.questStarted) > 0 then
            doPlayerSendTextMessage(cid, msgType, "3")
            if getCreatureStorage(cid, creature.questStorage) < creature.killsRequired then
                if getCreatureStorage(cid, creature.questStorage) < 0 then
                    doCreatureSetStorage(cid, creature.questStorage, 0)
                end
    
                if getCreatureStorage(cid, creature.creatureStorage) < 0 then
                    doCreatureSetStorage(cid, creature.creatureStorage, 0)
                end
                doCreatureSetStorage(cid, creature.questStorage, getCreatureStorage(cid, creature.questStorage) + 1)
                doCreatureSetStorage(cid, creature.creatureStorage, getCreatureStorage(cid, creature.creatureStorage) + 1)
                doPlayerSendTextMessage(cid, msgType, getCreatureStorage(cid, creature.creatureStorage) .. " " .. getCreatureName(target) .. " defeated. Total [" .. getCreatureStorage(cid, creature.questStorage) .. "/" .. creature.killsRequired .. "] " .. creature.raceName .. ".")
            end
        end
    end
    return true
end

creatureevent:register()

Don't add the isSummon function because it already exists and was causing problems.

Don't forget to register your script in login.lua
Code:
player:registerEvent("KillingInTheNameOf")

1721671445566.png
I hope this helps you
 
Back
Top