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

Change skull TFS 1.1

bomba

Member
Joined
Feb 26, 2008
Messages
635
Reaction score
7
Location
Brazil
What is the function to change skull in tfs 1.1?
I tryed:
Code:
function onLogin(cid)
    if getPlayerStorageValue(cid, honorStorage) >= 500 then
        doCreatureSetSkullType(cid, 0)
    else
        doCreatureSetSkullType(cid, 4)
    end
    return true
end
But don't work
 
You are using cid and cid isn't passed anymore instead userdata is now passed. That is first problem. Since userdata is passed the parameter cid is now the userdata instead of the creature id. You are also trying to use functions I don't think exist in 1.1, but I'm not sure. Anyway it goes the best way would be to use metamethods rather than use old functions, good practice to get used to 1.1's coding style. So here are some changes.


Code:
function onLogin(player) --- we traded cid for player, better variable name for the userdata object so we aren't confused
    if player:getStorageValue(honorStorage) >= 500 then  --- we use player object and metamethod no need in CID
        player:setSkull(0) -- player object and metamethod again
    else
        player:setSkull(4) -- player object and metamethod again
    end
    return true
end
 
You solved it, or you used my post??? Besides this was a request not a support issue, so if your request was met, and you learned something, maybe drop me a like?
 
Right on :D

I don't care about a like if someone learns and I helped to be a part of their progression.
 
Back
Top