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

Lua {TFS1.0}Hey i have started a project with a guy and we run into a quest lua problem!

Tarek

Premium User
Premium User
Joined
Jun 9, 2012
Messages
3,597
Solutions
4
Reaction score
1,186
Location
Sweden
GitHub
Taarek
SXGaKdg.jpg

My lua files

Code:
local boss = {
    ["fire overlord"] = {g_storage = 40064, p_storage = 60027},
    ["energy overlord"] = {g_storage = 40065, p_storage = 60028},
    ["ice overlord"] = {g_storage = 40066, p_storage = 60029},
    ["earth overlord"] = {g_storage = 40067, p_storage = 60030},
}


function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)
    local pid = Player(mostdamagekiller)

    local t = boss[Creature(cid):getName():lower()]

    Player(pid):setStorageValue(t.p_storage, 1)
    setGlobalStorageValue(t.g_storage, -1)

    return true
end


function onKill(cid, target)
    if Creature(target):getName():lower() == "lord of the elements" then
        Player(cid):setStorageValue(60031, 1)
    end

    return true
end

function onLogin(cid)
    Player(cid):registerEvent("ElementalSpheresKill")
    return true
end


@Gesior.pl
@Limos
@HalfAway
@whitevo
@Red
 
local boss = {
["fire overlord"] = {g_storage = 40064, p_storage = 60027},
["energy overlord"] = {g_storage = 40065, p_storage = 60028},
["ice overlord"] = {g_storage = 40066, p_storage = 60029},
["earth overlord"] = {g_storage = 40067, p_storage = 60030},
}


function onDeath(cid, corpse, lasthitkiller, mostdamagekiller, lasthitunjustified, mostdamageunjustified)

local pid = Player(mostdamagekiller)

bool CreatureEvent::executeOnDeath(Creature* creature, Item* corpse, Creature* killer, Creature* mostDamageKiller, bool lastHitUnjustified, bool mostDamageUnjustified) so local pid = Player(mostDamageKiller) and cid = creature

based on:
https://github.com/otland/forgotten...36b977b1a656a759a2a20cf/src/creatureevent.cpp
https://github.com/otland/forgotten...0cf/data/creaturescripts/scripts/droploot.lua
 
How did you register it?
You can do the player part like this.
Code:
local player = Player(mostdamagekiller)
if player then
     player:setStorageValue(t.p_storage, 1)
 
How did you register it?
You can do the player part like this.
Code:
local player = Player(mostdamagekiller)
if player then
     player:setStorageValue(t.p_storage, 1)
I did not register it.. this is the normal datapack from this forums
 
Back
Top