Postado Outubro 30, 2011 13 anos Olha, entendo um pouco de script mas isso aqui deve lhe ajudar. Ele faz com que utilize um item no player e aonde ele morrer, ira nascer onde ele morreu. Dai você já pode tirar como base, para vc criar seu script. Por: Notorious --[[ Ressurect Rune System 2.0 Developed by Notorious If you modify, please preserve credits --]] local function getCorpseInfo(uid) --~ function by Notorious local description = getItemSpecialDescription(uid) local _,_,owner_,killer_ = string.find(description, "You recognize (.+)%. %a* was killed by %a*%s*(.+)%.") return {owner = owner_ or nil, killer = killer_ or nil} end --~ These vars are not local because we have to use it in the talkaction deactivated, activated = -1, 1 --~ Change only if you know what you are doing config = { stoCheck = 100, stoPosx = 101, stoPosy = 102, stoPosz = 103, corpses = {6080, 3058, 3059}, securityDelay = 60 -- Seconds } function onUse(cid, item, frompos, item2, topos) if item2.uid == cid then return doPlayerSendCancel(cid, "You cannot use this rune on yourself.") end if isInArray(config.corpses, item2.itemid) then --~ Is it a valid corpse? local owner = getCorpseInfo(item2.uid).owner if owner then --~ Is it a [url="http://forums.otserv.com.br/#"]player[/url] corpse? owner = getCreatureByName(owner) if isPlayer(owner) then --~ Is the player online? doPlayerSendTextMessage(owner, MESSAGE_STATUS_CONSOLE_ORANGE, "Through the request from " .. getCreatureName(cid) .. " the gods are trying to ressurect you. Do you accept?") doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You requested the gods to ressurect " .. getCreatureName(owner) .. ".") doPlayerSetStorageValue(owner, config.stoCheck, activated) addEvent(doPlayerSetStorageValue, config.securityDelay*1000, owner, config.stoCheck, deactivated) -- Store corpse position -- doPlayerSetStorageValue(owner, config.stoPosx, getThingPos(item2.uid).x) doPlayerSetStorageValue(owner, config.stoPosy, getThingPos(item2.uid).y) doPlayerSetStorageValue(owner, config.stoPosz, getThingPos(item2.uid).z) ---------------------------- doSendMagicEffect(getThingPos(item2.uid), 2) doSendMagicEffect(getThingPos(item2.uid), 56) doRemoveItem(item.uid) doRemoveItem(item2.uid) else doPlayerSendCancel(cid, "The owner of this corpse is not [url="http://forums.otserv.com.br/#"]online[/url].") end else doPlayerSendCancel(cid, "This is not a corpse from a player.") end end return true end [/code] [b]Talkaction[/b] [code] --[[ Ressurect Rune System 2.0 Developed by Notorious If you modify, please preserve credits --]] function onSay(cid, words, param, channel) dofile(getDataDir() .. "actions/scripts/ressurect.lua") if getPlayerStorageValue(cid, config.stoCheck) == deactivated then return false end if words == "accept" or words == "yes" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been resurrected, the gods have blessed you.") doPlayerSetStorageValue(cid, config.stoCheck, deactivated) doTeleportThing(cid, {x=getPlayerStorageValue(cid, config.stoPosx), y=getPlayerStorageValue(cid, config.stoPosy), z=getPlayerStorageValue(cid, config.stoPosz)}) doSendMagicEffect(getThingPos(cid), 66) doSendMagicEffect(getThingPos(cid), 65) doSendMagicEffect(getThingPos(cid), 29) end if words == "decline" or words == "no" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You refused to ressurect.") doPlayerSetStorageValue(cid, config.stoCheck, deactivated) end return true end Repostando, tinha dado erro
Postado Outubro 30, 2011 13 anos Autor Thanks *_* Só que ainda acho muito difícil de intender essas funções, mas vlw. http://baiakuza.com/IP: baiakuza.com TIBIA: 10.96 Baiak Custom [ High Exp Rate ]
Postado Maio 2, 2013 12 anos Não testei e fiz rapidinho, mas é o caminho para oque deseja. <event type="death" name="DeathSavePositionByPcL" script="DeathSavePositionByPcL.lua"/> File DeathSavePositionByPcL.lua function onDeath(cid, corpse, deathList) doCreatureSetStorage(cid, 20000, getCreaturePosition(cid).x) doCreatureSetStorage(cid, 20001, getCreaturePosition(cid).y) doCreatureSetStorage(cid, 20002, getCreaturePosition(cid).z) return TRUE end <event type="login" name="LoginTeleportByPcL" event="script" value="LoginTeleportByPcL.lua"/> File LoginTeleportByPcL.lua function onLogin(cid) registerCreatureEvent(cid, DeathSavePositionByPcL) doTeleportThing(cid, {x=getCreatureStorage(cid, 20000), y=getCreatureStorage(cid, 20001), z=getCreatureStorage(cid, 20002)}, true) return true end Talvez funcione. =p Editado Maio 2, 2013 12 anos por HeberPcL (veja o histórico de edições) TeamSpeak 3 Public - TS.TeamSpeakClub.comwww.TeamSpeakClub.comCrie seu Canal Permanente!
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.