I need help fixing my rebirth look script..
Apparently when my char that has rebirthted x times and i look on myself it says: 12:42 You see yourself. You are a mage.
You have rebirth 1 time.
But when another player is trying to look at him it says: 12:42 You see Test mage (Level 110072). He is a mage
I would want it to say: 12:42 You see Test mage (Level 110072). He is a mage. He has rebirthed x times.
This is my script used at creaturescripts/scripts
giving rep+
Apparently when my char that has rebirthted x times and i look on myself it says: 12:42 You see yourself. You are a mage.
You have rebirth 1 time.
But when another player is trying to look at him it says: 12:42 You see Test mage (Level 110072). He is a mage
I would want it to say: 12:42 You see Test mage (Level 110072). He is a mage. He has rebirthed x times.
This is my script used at creaturescripts/scripts
Code:
function onLook(cid, thing, position, lookDistance)
if(isPlayer(thing.uid) and thing.uid ~= cid and getCreatureStorage(thing.uid, 85987) ~= -1) then
doPlayerSetSpecialDescription(thing.uid, (getPlayerSex(thing.uid) == PLAYERSEX_FEMALE and ".\nShe" or ".\nHe") .. " has rebirth " .. getCreatureStorage(thing.uid, 85987) .. " " .. (getCreatureStorage(thing.uid, 85987) == 1 and "time" or "times"))
elseif(thing.uid == cid and getCreatureStorage(cid, 85987) ~= -1) 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 rebirth " .. getCreatureStorage(cid, 85987) .. " " .. (getCreatureStorage(cid, 85987) == 1 and "time." or "times."))
end
return true
end
giving rep+