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

Prestige to Rebirth; [ERROR]

nicktm

Otland Helper
Joined
Oct 9, 2009
Messages
106
Reaction score
3
Location
Griffin, GA
Ok Otland My friend switched to 0.3.6 to 0.4, and it switched from prestige to reborn/rebirth, and now the prestige items wont work because the server now is bases of of rebirths and he doesnt want to delete accounts and switch back to prestige because all of his players will quit! Please Help! Rep ++! ~ Nick
 
use this script :D
step 1:
in creaturescript/scripts:

Lua:
Efunction 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 prestiged " .. 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 prestiged " .. getCreatureStorage(cid, 85987) .. " " .. (getCreatureStorage(cid, 85987) == 1 and "time." or "times."))
    end
 
    return true
end
name it rebirthdescription.lua

step 2:
then add this line in creaturescipts/creaturescripts.xml
XML:
<event type="look" name="RebirthDescription" event="script" value="rebirthdescription.lua"/>


step 3:
then this go to data/npc add new file prestige.lua
XML:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Prestige Npc" script="data/npc/scripts/rebirth.lua" walkinterval="2000" floorchange="0">
    <health now="100" max="100"/>
<look type="73" head="78" body="88" legs="0" feet="88" addons="3"/>
    <parameters>
        <parameter key="message_greet" value="Hello |PLAYERNAME|. Im in charge of the 'Prestige' system."/>
        <parameter key="message_farewell" value="Good bye my dear friend."/>
    </parameters>
</npc>
but make it prestige.xml if u want name it rebirthnpc or prestige like me

step4:
now go to npc/scripts
add this in rebirth.lua

Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
 
function onCreatureAppear(cid)                npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)            npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)            npcHandler:onCreatureSay(cid, type, msg) end
function onThink()                    npcHandler:onThink() end
 
function creatureSayCallback(cid, type, msg)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
 
    local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
 
    if(msgcontains(msg, 'prestige')) then
        selfSay('Are you ready to prestige and start a new life?', cid)
        talkState[talkUser] = 1
    elseif(msgcontains(msg, 'yes') and talkState[talkUser] == 1) then
        -------CONFIGS-------
        local level = 717217
        local cost = 0
        ------/CONFIGS-------
        -----LOCALS-----
        local id = getPlayerGUID(cid)
        local name = getCreatureName(cid)
        local vocation = getPlayerVocation(cid)
        local storage = getCreatureStorage(cid, 85987)
        ----/LOCALS-----
        if(getPlayerLevel(cid) >= level) then
            if(doPlayerRemoveMoney(cid, cost) == TRUE) then
                if(isInArray({1, 2, 3, 4, 5, 6, 7, 8}, vocation)) then
                    doCreatureSetStorage(cid, 85987, storage == -1 and 1 or storage + 1)
                    doRemoveCreature(cid)
                    db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `promotion` = 0 WHERE `id` ='"..id.."';")
                    db.executeQuery("UPDATE `players` SET `name` = '"..name.."' WHERE `id` ='"..id.."';")
                else
                    selfSay('Please talk with Forgotten King and promote first.', cid)
                    talkState[talkUser] = 0
                end
            else
                selfSay('You don\'t have enough money. You need to pay 1 gold coin to be rebirthed.', cid)
                talkState[talkUser] = 0
            end
        else
            selfSay('Only characters of level 717217 or higher can be rebirthed.', cid)
            talkState[talkUser] = 0
        end
    elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
        selfSay('Okey. Come back when you feel ready.', cid)
        talkState[talkUser] = 0
    end
 
    return true
end
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Step 5:go to creaturescript/script/login.lua and add this line
Lua:
    registerCreatureEvent(cid, "RebirthDescription")
:D :p

step6: now start ur server and test :D

PsS! this script its not my i found it like 1 month ago but iam using it in my server
REP+ me if it helped!!

Edited ! Remember rep+ me if it helped!

or if u want go buy rebirth system from him

http://otland.net/f485/fully-functional-rebirth-system-147666/
 
by me dont work !
[02/08/2012 19:50:40] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/rebirthdescription.lua:1: '=' expected near 'onLook'
[02/08/2012 19:50:40] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/rebirthdescription.lua)
[02/08/2012 19:50:40] data/creaturescripts/scripts/rebirthdescription.lua:1: '=' expected near 'onLook'
 
by me dont work !
[02/08/2012 19:50:40] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/rebirthdescription.lua:1: '=' expected near 'onLook'
[02/08/2012 19:50:40] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/rebirthdescription.lua)
[02/08/2012 19:50:40] data/creaturescripts/scripts/rebirthdescription.lua:1: '=' expected near 'onLook'

Remove the 'E' in the beginning of the script.
 
error.jpg

Now That If i make dubble click for show how many reborns the server shut down :(

- - - Updated - - -

error.jpg

Now That If i make dubble click for show how many reborns the server shut down :(
 
LOL where is your result if its worked where is my rep+++++++++++++++??????

LOL¡???? hahhaa
It seems an obligation on your part do not give him anything does not deserve nothing haha the reputation you win not you ask as obligation :)

copy and paste script...
Lua:
Efunction onLook(cid, thing, position, lookDistance)
I never see function E o_O!!
is
Lua:
function onLook(cid, thing, position, lookDistance)

@nicktm
http://otland.net/f83/prestige-rebirth-system-onlook-working-137755/
 
Last edited:
I only see by my self the prestigs not by other players.. :D

- - - Updated - - -

[02/08/2012 20:22:47] [Error - CreatureScript Interface]
[02/08/2012 20:22:47] data/creaturescripts/scripts/rebirthdescription.lua:eek:nLook
[02/08/2012 20:22:47] Description:
[02/08/2012 20:22:47] data/creaturescripts/scripts/rebirthdescription.lua:25: attempt to call global 'getClientVersion' (a nil value)
[02/08/2012 20:22:47] stack traceback:
[02/08/2012 20:22:47] data/creaturescripts/scripts/rebirthdescription.lua:25: in function <data/creaturescripts/scripts/rebirthdescription.lua:1>
 
try this:
Lua:
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 prestiged " .. 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) .. "]."
		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) .. " " .. (getCreatureStorage(cid, 85987) == 1 and "time." or "times."))
	end
 
	return true
end
 
first time after reload creaturescripts if i show on player the server will be shutdown and after restart i only see again my reborns but by other player ony so

20:36 You see Noob (Level 8). He is a elite knight
Military rank: Private.
And I
20:36 You see yourself. You are a elder druid.
You have prestiged 4 times.
 
Ok your scripts is the same then the old

if i put in and reload creaturescripts and i click then on player the server will be shut down and this error

[02/08/2012 20:22:47] [Error - CreatureScript Interface]
[02/08/2012 20:22:47] data/creaturescripts/scripts/rebirthdescription.luanLook
[02/08/2012 20:22:47] Description:
[02/08/2012 20:22:47] data/creaturescripts/scripts/rebirthdescription.lua:25: attempt to call global 'getClientVersion' (a nil value)
[02/08/2012 20:22:47] stack traceback:
[02/08/2012 20:22:47] data/creaturescripts

then i restart then i can click on other players whit no shut down but i dont see hear reborns only my own reborns !
 
Back
Top