• 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 Addons on Frags

[03/07/2010 05:27:27] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/FragAddons.lua:38: ')' expected near 'if'
[03/07/2010 05:27:27] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/FragAddons.lua)
[03/07/2010 05:27:27] data/creaturescripts/scripts/FragAddons.lua:38: ')' expected near 'if'
 
bump down
 
Last edited:
[03/07/2010 05:43:51] [Warning - BaseEvents::loadFromXml] Cannot open creaturescripts.xml file.
[03/07/2010 05:43:51] Line: 22, Info: Premature end of data in tag creaturescripts line 2


[03/07/2010 05:43:51] > ERROR: Unable to load CreatureEvents!
 
loooool i missed again, wait ,,,

you should be able to notice that :p there are 2 "bugs" in it
Code:
function onKill(cid, target, deathlist

try this:

@login.lua
Lua:
registerCreatureEvent(cid,'addonsForKill')

creaturescripts.xml
Lua:
<event type="kill" name="addonsForKill" event="script" value="addonsForKill.lua"/>

scripts/addonsForKill.lua
Lua:
local t = {
    baseSt = 1000, --storages from 1000 to 1021 will be used 
    frags = 999, --storage to store the amount of frags of the player
    }

local s = { --frags, storage, outfitID, name
    {1000,t.baseSt+20,21,'Yalaharian'},
    {900,t.baseSt+19,20,'Demonhunter'},
    {800,t.baseSt+18,19,'Brotherhood'},
    {700,t.baseSt+17,18,'Jester'},
    {600,t.baseSt+16,17,'Nightmare'},
    {525,t.baseSt+15,16,'Norsemen'},
    {450,t.baseSt+14,15,'Shaman'},
    {375,t.baseSt+13,14,'Beggar'},
    {325,t.baseSt+12,13,'Assassin'},
    {275,t.baseSt+11,12,'Pirate'},
    {225,t.baseSt+10,11,'Oriental'},
    {175,t.baseSt+9,10,'Wizard'},
    {150,t.baseSt+8,9,'Druid'},
    {125,t.baseSt+7,8,'Barbarian'},
    {100,t.baseSt+6,7,'Warrior'},
    {75,t.baseSt+5,6,'Summoner'},
    {50,t.baseSt+4,5,'Noble'},
    {35,t.baseSt+3,4,'Knight'},
    {20,t.baseSt+2,3,'Mage'},
    {10,t.baseSt+1,2,'Hunter'},
    {5,t.baseSt,1,'Citizen'},
    }
    
frags = function(cid) 
    for _, t in ipairs(s) do
        if getCreatureStorage(cid,t.frags) >= t[1] then
            return t
        end
    end
end

function onKill(cid, target, lastHit)
    if not isPlayer(cid) and not isPlayer(target) then
        return true
    end
    
    local frags,f = getCreatureStorage(cid,t.frags),frags(cid)
    doCreatureSetStorage(cid,t.frags,frags+1)

    if getCreatureStorage(cid,t.frags) > 4 and getCreatureStorage(cid,f(cid)[2]) == -1 then
        doPlayerAddOutfitId(cid,f(cid)[3],3)
        doPlayerSendTextMessage(cid,21,'For obtaining '.. frags ..' Frags total you are rewarded with full '.. f(cid)[4] ..' outfit addons!')
        doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))        
        doCreatureSetStorage(cid,f(cid)[2],1)  
    end
return true
end
:p huashuh :D
lets see watz happen next
 
try the link again
when its black doesnt work but when blue does
 
did you fix

Lua:
<event type="kill" name="addonsForKill" event="script" value="addonsForKill.lua">

with

Lua:
<event type="kill" name="addonsForKill" event="script" value="addonsForKill.lua"/>

? post creaturescripts.xml
 
yes its i did and server opened
iam testing it now

will can u make it from low frag need to test it faster
 
man just kill 6 ppl to get 1st addons
 
[03/07/2010 06:03:11] [Error - CreatureScript Interface]
[03/07/2010 06:03:11] data/creaturescripts/scripts/addonsForKill.lua:eek:nKill
[03/07/2010 06:03:11] Description:
[03/07/2010 06:03:11] data/creaturescripts/scripts/addonsForKill.lua:46: attempt to call local 'f' (a nil value)
[03/07/2010 06:03:11] stack traceback:
[03/07/2010 06:03:11] data/creaturescripts/scripts/addonsForKill.lua:46: in function <data/creaturescripts/scripts/addonsForKill.lua:38>


the player dont die while his hp black
 
naj i'll test and fix it
i'll post bk later
 
well before i go try this
Lua:
  local t = {
    baseSt = 1000, --storages from 1000 to 1021 will be used
    frags = 999, --storage to store the amount of frags of the player
    }

local s = { --frags, storage, outfitID, name
    {1000,t.baseSt+20,21,'Yalaharian'},
    {900,t.baseSt+19,20,'Demonhunter'},
    {800,t.baseSt+18,19,'Brotherhood'},
    {700,t.baseSt+17,18,'Jester'},
    {600,t.baseSt+16,17,'Nightmare'},
    {525,t.baseSt+15,16,'Norsemen'},
    {450,t.baseSt+14,15,'Shaman'},
    {375,t.baseSt+13,14,'Beggar'},
    {325,t.baseSt+12,13,'Assassin'},
    {275,t.baseSt+11,12,'Pirate'},
    {225,t.baseSt+10,11,'Oriental'},
    {175,t.baseSt+9,10,'Wizard'},
    {150,t.baseSt+8,9,'Druid'},
    {125,t.baseSt+7,8,'Barbarian'},
    {100,t.baseSt+6,7,'Warrior'},
    {75,t.baseSt+5,6,'Summoner'},
    {50,t.baseSt+4,5,'Noble'},
    {35,t.baseSt+3,4,'Knight'},
    {20,t.baseSt+2,3,'Mage'},
    {10,t.baseSt+1,2,'Hunter'},
    {5,t.baseSt,1,'Citizen'},
    }
   
frags = function(cid)
    for _, t in ipairs(s) do
        if getCreatureStorage(cid,t.frags) >= t[1] then
            return t
        end
    end
end

function onKill(cid, target, lastHit)
    if not isPlayer(cid) and not isPlayer(target) then
        return true
    end
   
    local frags, f = getCreatureStorage(cid,t.frags),frags(cid)
    doCreatureSetStorage(cid,t.frags,frags+1)

    if getCreatureStorage(cid,t.frags) > 4 and getCreatureStorage(cid,f[2]) == -1 then
        doPlayerAddOutfitId(cid,f[3],3)
        doPlayerSendTextMessage(cid,21,'For obtaining '.. frags ..' Frags total you are rewarded with full '.. f[4] ..' outfit addons!')
        doSendMagicEffect(getCreaturePosition(cid), math.random(1, 67))        
        doCreatureSetStorage(cid,f[2],1)  
    end
return true
end
 
[03/07/2010 07:17:55] [Error - CreatureScript Interface]
[03/07/2010 07:17:55] data/creaturescripts/scripts/addonsForKill.lua:eek:nKill
[03/07/2010 07:17:55] Description:
[03/07/2010 07:17:55] data/creaturescripts/scripts/addonsForKill.lua:46: attempt to index local 'f' (a nil value)
[03/07/2010 07:17:55] stack traceback:
[03/07/2010 07:17:55] data/creaturescripts/scripts/addonsForKill.lua:46: in function <data/creaturescripts/scripts/addonsForKill.lua:38>
[03/07/2010 07:17:55] mysql_real_query(): UPDATE `players` SET `frags` = `frags` + 1 WHERE `id` = 7; - MYSQL ERROR: Unknown column 'frags' in 'field list' (1054)
 
Back
Top