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

CreatureEvent help error in outfit for vocation

jhonatan12

New Member
Joined
Jan 29, 2010
Messages
11
Reaction score
0
I have this scripts

Code:
-- Script by Cybermaster
   -- Fix by Shawak
--Rescripted, based on vocations
 
  --[[
        [1] = Sorcerer
        [2] = Druid
        [3] = Paladin
   [4] = Knight
   [5] = Master Sorcerer
   [6] = Elder Druid
   [7] = Royal Paladin
   [8] = Elite Knight
]]--
 
 
local outfits = {
        [1] = {lookType = 266, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
        [2] = {lookType = 266, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
        [3] = {lookType = 266, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
        [4] = {lookType = 75, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
        [5] = {lookType = 301, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
   [6] = {lookType = 301, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
   [7] = {lookType = 301, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0},
   [8] = {lookType = 301, lookHead = 114 , lookBody = 18, lookLegs = 94, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
}
 
function onLogin(cid)
        local voc_id = getPlayerVocation(cid)
        if getPlayerVocation(cid) > 0 then
                doSetCreatureOutfit(cid, outfits[voc_id], -1)
        end
        return TRUE
end

But the console send me this error

04/03/2012 13:47:02] [Error - CreatureScript Interface]
[04/03/2012 13:47:02] data/creaturescripts/scripts/outfit.lua:eek:nLogin
[04/03/2012 13:47:02] Description:
[04/03/2012 13:47:02] attempt to index a nil value
[04/03/2012 13:47:02] stack traceback:
[04/03/2012 13:47:02] [C]: in function 'doSetCreatureOutfit'
[04/03/2012 13:47:02] data/creaturescripts/scripts/outfit.lua:31: in function
 
Code:
function onLogin(cid)
        if outfits[getPlayerVocation(cid)] then
                doSetCreatureOutfit(cid, outfits[getPlayerVocation(cid)], -1)
        end
        return TRUE
end
 
Back
Top