Tjay
Retired Hoster
I just Put a Rebirth system into my server and i have everything working right. Besides one thing and thats the onlook.lua i have its not working, but im not getting any errors. this is what i have at the moment.
and this in Creaturescripts.lua
Anyone know what i need to do for this to work. it should be like
You see player name(level). He is vocation. he was rebirth X times.
Thanks,
Tjay
Code:
local minlvl = 80000
local newlvl = 8
function onLook(cid, thing, position, lookDistance)
if isPlayer(thing.uid) then
local rebirth = math.floor(((getCreatureMaxHealth(thing.uid)-(getVocationInfo(getPlayerVocation(thing.uid)).hea lthGain*getPlayerLevel(thing.uid)+150))/((minlvl-1-newlvl)*getVocationInfo(getPlayerVocation(thing.ui d)).healthGain)))
if getPlayerSex(thing.uid) == 0 and rebirth > 0 then
doPlayerSendTextMessage(cid, 25,"You see " .. getCreatureName(thing.uid) .. "(Level " .. getPlayerLevel(thing.uid) .. "). She is a " .. getVocationInfo(getPlayerVocation(thing.uid)).name .. ". She was "..rebirth.." times reborn.")
elseif getPlayerSex(thing.uid) == 1 and rebirth > 0 then
doPlayerSendTextMessage(cid, 25,"You see " .. getCreatureName(thing.uid) .. "(Level " .. getPlayerLevel(thing.uid) .. "). He is a " .. getVocationInfo(getPlayerVocation(thing.uid)).name .. ". He was "..rebirth.." times reborn.")
else
doPlayerSendTextMessage(cid, 25,"You see " .. getCreatureName(thing.uid) .. "(Level " .. getPlayerLevel(thing.uid) .. "). It is a " .. getVocationInfo(getPlayerVocation(thing.uid)).name .. ".")
end
end
return false
end
and this in Creaturescripts.lua
Code:
<event type="look" name="test" event="script" value="onlook.lua"/>
Anyone know what i need to do for this to work. it should be like
You see player name(level). He is vocation. he was rebirth X times.
Thanks,
Tjay