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

error when i use look

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
Plzzz help me, when i use look on someone, just on someone this error ocurre :/


PHP:
[18/12/2012 19:01:31] [Error - CreatureScript Interface] 
[18/12/2012 19:01:31] data/creaturescripts/scripts/rebirthdescription.lua:onLook
[18/12/2012 19:01:31] Description: 
[18/12/2012 19:01:31] data/creaturescripts/scripts/rebirthdescription.lua:24: attempt to call global 'getClientVersion' (a nil value)
[18/12/2012 19:01:31] stack traceback:
[18/12/2012 19:01:31] 	data/creaturescripts/scripts/rebirthdescription.lua:24: in function <data/creaturescripts/scripts/rebirthdescription.lua:1>

and this is the rebirthdescription
LUA:
function onLook(cid, thing, position, lookDistance) 
    if isPlayer(thing.uid) and thing.uid ~= cid then
		local sex = getPlayerSex(thing.uid)
        local message = "You see " .. getPlayerName(thing.uid) .. " (Level " .. getPlayerLevel(thing.uid) .. ")." 
        if(getPlayerFlagValue(thing.uid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is a " .. getPlayerGroupName(thing.uid) .. "." 
        elseif(getPlayerVocation(thing.uid) ~= 0) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is a " .. getPlayerVocationName(thing.uid):lower() .. "." 
        else 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " has no vocation." 
        end 
 
        if(getPlayerNameByGUID(getPlayerPartner(thing.uid), false, false) ~= nil) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is " .. (sex == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerNameByGUID(getPlayerPartner(thing.uid)) .. "." 
        end 
 
        if(getPlayerGuildId(thing.uid) > 0) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is " .. (getPlayerGuildRank(thing.uid) == "" and "a member" or getPlayerGuildRank(thing.uid)) .. " of the " .. getPlayerGuildName(thing.uid) 
            message = getPlayerGuildNick(thing.uid) ~= "" and message .. " (" .. getPlayerGuildNick(thing.uid) .. ")." or message .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then 
            message = message .. "\nHealth: [" .. getCreatureHealth(thing.uid) .. " / " .. getCreatureMaxHealth(thing.uid) .. "], Mana: [" .. getCreatureMana(thing.uid) .. " / " .. getCreatureMaxMana(thing.uid) .. "]." 
            message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(thing.uid)) .. ", Client: " .. getClientVersion(thing.uid) .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then 
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]." 
        end 
 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. (sex == PLAYERSEX_FEMALE and " \nShe" or " \nHe") .. " has prestiged " .. (getCreatureStorage(thing.uid, 85987) == -1 and "0" or getCreatureStorage(thing.uid, 85987)) .. " " .. (math.abs(getCreatureStorage(thing.uid, 85987)) == 1 and "time." or "times."))
		return false
    elseif thing.uid == cid then 
        local message = "You see yourself." 
        if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then 
            message = message .. " You are " .. getPlayerGroupName(cid) .. "." 
        elseif(getPlayerVocation(cid) ~= 0) then 
            message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. "." 
        else 
            message = message .. " You have no vocation." 
        end 
 
        if(getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil) then 
            message = message .. " You are " .. (getPlayerSex(cid) == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerNameByGUID(getPlayerPartner(cid)) .. "." 
        end 
 
        if(getPlayerGuildId(cid) > 0) then 
            message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid) 
            message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then 
            message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]." 
            message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. ", Client: " .. getClientVersion(cid) .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then 
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]." 
        end 
 
        return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \nYou have prestiged " .. (getCreatureStorage(cid, 85987) == -1 and "0" or getCreatureStorage(cid, 85987)) .. " " .. (getCreatureStorage(cid, 85987) == 1 and "time." or "times.")) 
    end 
 
    return true 
end
 
try
LUA:
function onLook(cid, thing, position, lookDistance) 
    if isPlayer(thing.uid) and thing.uid ~= cid then
		local sex = getPlayerSex(thing.uid)
        local message = "You see " .. getPlayerName(thing.uid) .. " (Level " .. getPlayerLevel(thing.uid) .. ")." 
        if(getPlayerFlagValue(thing.uid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is a " .. getPlayerGroupName(thing.uid) .. "." 
        elseif(getPlayerVocation(thing.uid) ~= 0) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is a " .. getPlayerVocationName(thing.uid):lower() .. "." 
        else 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " has no vocation." 
        end 
 
        if(getPlayerNameByGUID(getPlayerPartner(thing.uid), false, false) ~= nil) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is " .. (sex == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerNameByGUID(getPlayerPartner(thing.uid)) .. "." 
        end 
 
        if(getPlayerGuildId(thing.uid) > 0) then 
            message = message .. " " .. (sex == PLAYERSEX_FEMALE and "She" or "He") .. " is " .. (getPlayerGuildRank(thing.uid) == "" and "a member" or getPlayerGuildRank(thing.uid)) .. " of the " .. getPlayerGuildName(thing.uid) 
            message = getPlayerGuildNick(thing.uid) ~= "" and message .. " (" .. getPlayerGuildNick(thing.uid) .. ")." or message .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then 
            message = message .. "\nHealth: [" .. getCreatureHealth(thing.uid) .. " / " .. getCreatureMaxHealth(thing.uid) .. "], Mana: [" .. getCreatureMana(thing.uid) .. " / " .. getCreatureMaxMana(thing.uid) .. "]."  
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then 
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]." 
        end 
 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. (sex == PLAYERSEX_FEMALE and " \nShe" or " \nHe") .. " has prestiged " .. (getCreatureStorage(thing.uid, 85987) == -1 and "0" or getCreatureStorage(thing.uid, 85987)) .. " " .. (math.abs(getCreatureStorage(thing.uid, 85987)) == 1 and "time." or "times."))
		return false
    elseif thing.uid == cid then 
        local message = "You see yourself." 
        if(getPlayerFlagValue(cid, PLAYERFLAG_SHOWGROUPINSTEADOFVOCATION)) then 
            message = message .. " You are " .. getPlayerGroupName(cid) .. "." 
        elseif(getPlayerVocation(cid) ~= 0) then 
            message = message .. " You are a " .. getPlayerVocationName(cid):lower() .. "." 
        else 
            message = message .. " You have no vocation." 
        end 
 
        if(getPlayerNameByGUID(getPlayerPartner(cid), false, false) ~= nil) then 
            message = message .. " You are " .. (getPlayerSex(cid) == PLAYERSEX_FEMALE and "wife" or "husband") .. " of " .. getPlayerNameByGUID(getPlayerPartner(cid)) .. "." 
        end 
 
        if(getPlayerGuildId(cid) > 0) then 
            message = message .. " You are " .. (getPlayerGuildRank(cid) == "" and "a member" or getPlayerGuildRank(cid)) .. " of the " .. getPlayerGuildName(cid) 
            message = getPlayerGuildNick(cid) ~= "" and message .. " (" .. getPlayerGuildNick(cid) .. ")." or message .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEECREATUREDETAILS)) then 
            message = message .. "\nHealth: [" .. getCreatureHealth(cid) .. " / " .. getCreatureMaxHealth(cid) .. "], Mana: [" .. getCreatureMana(cid) .. " / " .. getCreatureMaxMana(cid) .. "]." 
            message = message .. "\nIP: " .. doConvertIntegerToIp(getPlayerIp(cid)) .. ", Client: " .. getClientVersion(cid) .. "." 
        end 
 
        if(getPlayerFlagValue(cid, PLAYERCUSTOMFLAG_CANSEEPOSITION)) then 
            message = message .. "\nPosition: [X: " .. position.x .. "] [Y: " .. position.y .. "] [Z: " .. position.z .. "]." 
        end 
 
        return false, doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, message .. " \nYou have prestiged " .. (getCreatureStorage(cid, 85987) == -1 and "0" or getCreatureStorage(cid, 85987)) .. " " .. (getCreatureStorage(cid, 85987) == 1 and "time." or "times.")) 
    end 
 
    return true 
end
 
Back
Top