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

Reborn Doors ! Help!

Notsus

New Member
Joined
Oct 4, 2013
Messages
4
Reaction score
0
I have this script with reborns
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}

local reborn = 2500 -- free storage
local spellReborn = {
[1] = 'Reborn spell #1',
[5] = 'Reborn spell #5',
[10] = 'Reborn spell #10',
[25] = 'Reborn spell #25',
[50] = 'Reborn spell #50',
[100] = 'Reborn spell #100',
[250] = 'Reborn spell #250',
[500] = 'Reborn spell #500'
}
local level = 717217
local maxReborns = 5000
local toLevel = 101

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 greetCallback(cid)
Topic[cid] = nil
return true
end

function creatureSayCallback(cid, type, msg)
if not npcHandler:isFocused(cid) then
return false
elseif Topic[cid] then
if msgcontains(msg, 'yes') then
if getCreatureStorage(cid, reborn) < maxReborns then
doCreatureSetStorage(cid, reborn, math.max(0, getCreatureStorage(cid, reborn)) + 1)
for k, v in pairs(spellReborn) do
if getCreatureStorage(cid, reborn) == k then
doPlayerLearnInstantSpell(cid, v)
doSendMagicEffect(getThingPosition(cid), CONST_ME_FIREWORK_RED)
break
end
end

local g = getPlayerGUID(cid)
npcHandler:releaseFocus(cid)
doRemoveCreature(cid)
db.executeQuery('UPDATE players SET level=99,experience=15219400 WHERE id=' .. g)
else
npcHandler:say('You reached maximum amount of reborns.', cid)
end
else
npcHandler:say('Maybe next time.', cid)
end
Topic[cid] = nil
else
if msgcontains(msg, 'reborn') then
if getPlayerLevel(cid) >= level then
npcHandler:say('Reborned you ?',cid)
Topic[cid] = 1
else
npcHandler:say('You don\'t have enough level. ['..level..']',cid)
Topic[cid] = nil
end
end
end
return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
I can't make script doors to this reborn system who help me ! PLS!
 
I got this script
Code:
local str = 456 -- rebirth storage
local rebirth = 5 -- rebirth to pass the door
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getCreatureStorage(cid, str) >= rebirth then
if getCreaturePosition(cid).x < toPosition.x then
doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, true)
else
doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, true)
end
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end
return false
end
 
Hmm...not run. When i went open doors with req. 1 reborn write you don't have 1 reborn but doors open it :( What is ?
32398857916476709084.jpg
 
Last edited:
Back
Top