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

doCreatureSetGuildEmblem (a nil value)

UchihaClan

Only you can be you
Joined
Oct 25, 2014
Messages
164
Reaction score
33
Hey!
I got a little problem in my server. I use a war server with tfs 0.3.6 and when people get 250 frags they get a emblem but when people get 250 frags they can´t log in and I get a error in my console.
This is the error I get in my console, and in log.lua:13 it says this is maybe connected to the skull.lua



Code:
function onLogin(cid)
    local frags = math.max(0, getPlayerStorageValue(cid, 20233))
    if(frags >= 5000) then
        doCreatureSetGuildEmblem(cid, EMBLEM_RED)
    elseif(frags >= 1500) then
        doCreatureSetGuildEmblem(cid, EMBLEM_BLUE)
    elseif(frags >= 250) then
        doCreatureSetGuildEmblem(cid, EMBLEM_GREEN)                          RAD 13 <<<<<<<<

[code]
[28/10/2014 18:11:40] [Error - CreatureScript Interface] 
[28/10/2014 18:11:40] data/creaturescripts/scripts/login.lua:onLogin
[28/10/2014 18:11:40] Description: 
[28/10/2014 18:11:40] data/creaturescripts/scripts/login.lua:13: attempt to call global 'doCreatureSetGuildEmblem' (a nil value)
[28/10/2014 18:11:40] stack traceback:
[28/10/2014 18:11:40]     data/creaturescripts/scripts/login.lua:13: in function <data/creaturescripts/scripts/login.lua:6>
 
Woops forgot to paste the skull.lua
Code:
ocal storage = 20233
local reward = {
        item = 5953,
        count = 1
}
function onKill(cid, target, flags, damage)
    if isPlayer(target) then
        --[[if getPlayerIp(cid) ~= getPlayerIp(target) then]]
                local frags = math.max(0, getPlayerStorageValue(cid, storage))
                doCreatureSetStorage(cid, storage, frags+1)
                if(frags >= 5000) then
                    doCreatureSetGuildEmblem(cid, EMBLEM_RED)
                elseif(frags >= 1500) then
                    doCreatureSetGuildEmblem(cid, EMBLEM_BLUE)
                elseif(frags >= 250) then
                    doCreatureSetGuildEmblem(cid, EMBLEM_GREEN)
                end
               
                if getPlayerItemCount(cid, reward.item) > 0 then
                    local item = getPlayerItemById(cid, true, reward.item)
                    if item.type >= 100 then
                        doPlayerAddItem(cid, reward.item, reward.count)
                    else
                        doTransformItem(item.uid, reward.item, item.type + 1)
                    end
                else
                    doPlayerAddItem(cid, reward.item, reward.count)
                end
                doSendAnimatedText(getPlayerPosition(cid), "Frag!", TEXTCOLOR_RED)
        --[[else
            doPlayerSendTextMessage(cid, 18, "You didn't get frag/reward because of killing a player with same ip.")
        end]]
    end
    return true
end
 
This is a source function from TFS 0.4 that doesn't exist in TFS 0.3.6, so you can just remove that part.

Next time, describe your problem in your title, I've edited it for you this time.
 
Back
Top