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

Help. Rebirth script 8.0 xml ?

aas

Unholy/Azilias
Joined
Nov 5, 2010
Messages
32
Reaction score
2
Location
Estonia
Well as title sayed i want to know if it is possible to make that script for 8.0 xml?
 
How can i make this script to make person who get that promotion , be turned back to lvl 8?

Code:
local focus = 0
local talk_start = 0
local target = 0
local days = 0

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end


function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hail') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
 		selfSay('Hello ' .. creatureGetName(cid) .. '! I sell Master promotion.')
 		focus = cid
 		talk_start = os.clock()

	elseif msgcontains(msg, 'hail') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

  	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'promotion') or msgcontains(msg, 'promote') then
 			if getPlayerVocation(cid) > 8 then
 				selfSay('Sorry, you are already promoted.')
 				talk_state = 0
 			elseif getPlayerLevel(cid) < 2000 then
				selfSay('Sorry, you need level 2000 to buy Master promotion.')
				talk_state = 0
			elseif not isPremium(cid) then
				selfSay('Sorry, you must be premium and own previous promotion to buy Master promotion.')
				talk_state = 0
			else
				selfSay('Do you want to buy Master promotion for 200k?')
				talk_state = 1
			end

	elseif talk_state == 1 then
			if msgcontains(msg, 'yes') then
				if pay(cid,200000) then
					doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
					selfSay('You are now promoted!')
				else
					selfSay('Sorry, you do not have enough money.')
				end
 			end
			talk_state = 0


  		elseif msgcontains(msg, 'bye')  and getDistanceToCreature(cid) < 4 then
  			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
  			focus = 0
  			talk_start = 0
  		end
  	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
	doNpcSetCreatureFocus(focus)
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Dont ignore me like this!')
  		end
  			focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end

- - - Updated - - -

Found another script, but i do get an error: Lua script error: [Action interface] data/actions scripts/holyfalcon.lua : onUse
data/actions/scripts/holyfalcon.lua:8: attempt to call global 'getExperienceForlevel' (a nil value)

Code:
local config = {
    levelReq = 20000,
    toLevel = 8,
    RebornItem = 2141
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, 15328) < 1 and getPlayerLevel(cid) >= config.levelReq and doPlayerRemoveItem(cid, config.RebornItem, 1) then
            doPlayerAddExperience(cid, -(getExperienceForLevel(getPlayerLevel(cid)) - getExperienceForLevel(config.toLevel)))
            doPlayerSendTextMessage(cid, 22, "You've been reborn")
                  doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
    else
        doPlayerSendCancel(cid, "You're not ready to take your reborn or you're already reborned!")
    end
    return true
end
 
Last edited:
Back
Top