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

CreatureEvent Revive From Death V. 1.0// Cyko Production

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,782
Solutions
31
Reaction score
2,285
Location
Sweden?
Hello,

This script is configured that, if player has this special storage which he can get from a npc or a item, then when he dies then he get revived, but depends which time you configured it. Pretty simple and neat script.

Also i would love tips about what i can add and need help with change outfit to dead corpse and maybe add countdown. Idk but still version 1 xD

Tested on 0.3.6

First go to creaturescripts/creaturescripts.xml and add this line below:
Code:
<event type="PrepareDeath" name="Revive" event="script" value="revive.lua"/>

Now go to creaturescripts/scripts/login.lua and paste this line below:
Code:
registerCreatureEvent(cid, "Revive")

Now goto creaturescripts/scripts and create new lua and name it "revive" and paste the code below:
Lua:
local Cyko = {
	storage = 9999, --Use empty storage
	outfit = {lookType = 0}, --still working on the to turn into dead body
	time = 5, --How long will it take until he revives from the death
	text = "You will be revived in 5 seconds" --The text which appear when his dead
}

function onPrepareDeath(cid, deathList)

function revive(cid)
	if isPlayer(cid) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid), true)
		doCreatureSetNoMove(cid, false)
		setPlayerStorageValue(cid, Cyko.storage, 1)
		return true
	end
end

function revivetext(cid)
	if isPlayer(cid) then
		doPlayerSendTextMessage(cid,21, Cyko.text)
		addEvent(revive, cyko.time*1000, cid)
		return true
	end
end

	if isPlayer(cid) and getPlayerStorageValue(cid, Cyko.storage) == 1 then
		if getCreatureHealth(cid) <= 0 then	
			addEvent(revivetext, 1*1, cid)
			doCreatureSetNoMove(cid, true)
			doCreatureChangeOutfit(cid, Cyko.outfit)
			doAddCondition(cid, CONDITION_INFIGHT)
			return false
		end
	return true
	end
end

Enjoy! Im open for suggestions and help me bit, so ill learn :)!

Thanks!

The scripts works dont worry!
 
Great! usefull for me! but why "outfit = 0", it make you invisible?
 
Yes, but I tried to make look like corpse but didn't work.
 
Well, when i saw this, i thought it would not work for me...i tested and true
1-The player don't die (if don't have storage)
2-The text message repeat each 0.5seconds
3 -The Outfit >> debug (i know, change 0..)
4-The dead player continues to advance shielding

But I really liked the idea, many other RPGs we see it, very good! Perhaps in the future you do a spell to revive..or maybe i do

Sorry for a possible error in the language ..
 
Kinda buged for tfs 0.4 :D if you die then you dont get back to life it just keep ur forever 0 hp and you can keep atk monsters xD
 
Back
Top