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

Level 8-50 die, get teletrasported to temple, lossing nothing, killer doesnt get frag

Fyruz

★★★★★
Joined
Feb 7, 2009
Messages
556
Reaction score
19
Location
127.0.0.1
Hello i want a script that when you are level 8-50 and you go out into a pvp zone, if u get killed u get teletransported to the temple, and the player doesnt loss anything, and the killer doesnt get a frag i rep++
 
Script..

Lua:
function onPrepareDeath(cid, deathList)
    if isPlayer(cid) and getPlayerLevel(cid) <= 50 then
        for i = 0, 4 do
            doPlayerSetLossPercent(cid, i, 0)
        end
    end
    return true
end

creaturescripts.xml

Lua:
<event type="preparedeath" name="prevent" event="script" value="prevent.lua"/>

Login.lua
Lua:
registerCreatureEvent(cid, "prevent")
 
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
doCreatureAddMana(cid, getCreatureMaxMana(cid))
missing this
 
Lua:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 50 then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doRemoveConditions(cid, false)
		return false
	end
	return true
end
 
Lua:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 50 then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doRemoveConditions(cid, false)
		return false
	end
	return true
end




Cyko, can you fix a script for me?
If player level 50- die will lose NOTHING (level, skills, itens, mlvl)

Thank you
 
What's wrong with that script?

Nothing wrong but player is not dying.
Is possible to make this: (?
If level 49- DIE will lose nothing BUT if lv49- DIE PK~RED will lose normal


REASON: IF lv49- get red skull he will drop nothing. People will create makers lv45 to pk, get red, black and lose nothing.

Thank you
 
Lua:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 50 and getCreatureSkullType(cid) < SKULL_WHITE then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doRemoveConditions(cid, false)
		return false
	end
	return true
end
 
Lua:
function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 50 and getCreatureSkullType(cid) < SKULL_WHITE then
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doRemoveConditions(cid, false)
		return false
	end
	return true
end

Is possible to make the player dies without losing nothing?
The player is just being teleported to temple when reach health = 0

Thank you.
 
You want when they died (lvl 1-50) they still keep the corpose, but they will not losee skills bla bla....?

function onPrepareDeath(cid, deathList)
if getPlayerLevel(cid) < 50 and getCreatureSkullType(cid) < SKULL_WHITE then
doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
doCreatureAddMana(cid, getCreatureMaxMana(cid))
doRemoveConditions(cid, false)
return false
end
return true
end

This script is working fine, but I want the corpse, I want a real thing.
 
Lua:
function getNameDescription(creature)
	local v = getCreatureName(creature)
	return isMonster(creature) and getMonsterInfo(v).description or v
end

function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 50 and getCreatureSkullType(cid) < SKULL_WHITE then
		local corpse, ss = doCreateItem(getPlayerSex(cid) == 0 and 6081 or 6080, 1, getThingPos(cid)), ''
		ss = "You recognize " .. getCreatureName(cid) ..  ". " .. (getPlayerSex(cid) % 2 ~= 0 and "He" or "She") .. " was killed by "
		if isCreature(deathList[1]) then
			ss = ss .. getNameDescription(deathList[1])
			local master = getCreatureMaster(deathList[1])
			if master and master ~= deathList[1] then
				ss = ss .. " summoned by " .. getNameDescription(master)
			end
		else
			ss = ss .. deathList[1]
		end

		if #deathList > 1 then
			if type(deathList[1]) ~= type(deathList[2]) then
				if isCreature(deathList[2]) then
					ss = ss .. " and by " .. getNameDescription(deathList[2])
					local master = getCreatureMaster(deathList[2])
					if master and master ~= deathList[2] then
						ss = ss .. " summoned by " .. getNameDescription(master)
					end
				else
					ss = ss .. " and by " .. deathList[2]
				end
			elseif isCreature(deathList[2]) then
				if getNameDescription(deathList[1]) ~= getNameDescription(deathList[2]) then
					ss = ss .. " and by " .. getNameDescription(deathList[2])
					local master = getCreatureMaster(deathList[2])
					if master and master ~= deathList[2] then
						ss = ss .. " summoned by " .. getNameDescription(master)
					end
				end
			elseif deathList[1]:lower() ~= deathList[2]:lower() then
				ss = ss .. " and by " .. deathList[2]
			end
		end
		doItemSetAttribute(corpse, 'description', ss)
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doRemoveConditions(cid, false)
		return false
	end
	return true
end
 
Last edited:
Lua:
function getNameDescription(creature)
	local v = getCreatureName(creature)
	return isMonster(creature) and getMonsterInfo(v).description or v
end

function onPrepareDeath(cid, deathList)
	if getPlayerLevel(cid) < 50 and getCreatureSkullType(cid) < SKULL_WHITE then
		local corpse, ss = doCreateItem(getPlayerSex(cid) == 0 and 6081 or 6080, 1, getThingPos(cid)), ''
		ss = "You recognize " .. getCreatureName(cid) ..  ". " .. (getPlayerSex(cid) % 2 ~= 0 and "He" or "She") .. " was killed by "
		if isCreature(deathList[1]) then
			ss = ss .. getNameDescription(deathList[1])
			local master = getCreatureMaster(deathList[1])
			if master and master ~= deathList[1] then
				ss = ss .. " summoned by " .. getNameDescription(master)
			end
		else
			ss = ss .. deathList[1]
		end

		if #deathList > 1 then
			if type(deathList[1]) ~= type(deathList[2]) then
				if isCreature(deathList[2]) then
					ss = ss .. " and by " .. getNameDescription(deathList[2])
					local master = getCreatureMaster(deathList[2])
					if master and master ~= deathList[2] then
						ss = ss .. " summoned by " .. getNameDescription(master)
					end
				else
					ss = ss .. " and by " .. deathList[2]
				end
			elseif isCreature(deathList[2]) then
				if getNameDescription(deathList[1]) ~= getNameDescription(deathList[2]) then
					ss = ss .. " and by " .. getNameDescription(deathList[2])
					local master = getCreatureMaster(deathList[2])
					if master and master ~= deathList[2] then
						ss = ss .. " summoned by " .. getNameDescription(master)
					end
				end
			elseif deathList[1]:lower() ~= deathList[2]:lower() then
				ss = ss .. " and by " .. deathList[2]
			end
		end
		doItemSetAttribute(corpse, 'description', killers)
		doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), 65535, 256, true)
		doCreatureAddMana(cid, getCreatureMaxMana(cid))
		doRemoveConditions(cid, false)
		return false
	end
	return true
end

I've found some problems:
1. 23:31 You see a dead human (Vol:10).
2. Player that kills lv49- do not get frag
3.
60326183.jpg
 
Back
Top Bottom