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

Remove Items

Castic

Member
Joined
Sep 10, 2010
Messages
175
Reaction score
7
I need a script that when you die in a certain area, all of your items will be removed. Like your backpack, armor, etc. I need this for an event, to prevent people keeping items from the event.
 
Lua:
local area = { frompos = {x=,y=,z=}, topos = = {x=,y=,z=} }

function onDeath(cid)
	if isInRange(getThingPos(cid),area.frompos, area.topos) then
		for i = 1, 10 do
			local item = getPlayerSlotItem(cid,i).uid
			if item.uid > 0 then
				doRemoveItem(item.uid)
			end
		end
	end
	return true
end
 
Ah, thanks!

EDIT:
I got this error
Code:
[13:28:06.377] [Error - LuaInterface::loadFile] data/creaturescripts/scripts/death.lua:1: unexpected symbol near '='
[13:28:06.377] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/death.lua)
[13:28:06.377] data/creaturescripts/scripts/death.lua:1: unexpected symbol near '='
 
Last edited:
Lua:
local area = { frompos = {x=1,y=1,z=1}, topos = {x=1,y=1,z=1} }
 
function onDeath(cid)
	if isInRange(getThingPos(cid),area.frompos, area.topos) then
		for i = 1, 10 do
			local item = getPlayerSlotItem(cid,i).uid
			if item.uid > 0 then
				doRemoveItem(item.uid)
			end
		end
	end
	return true
end
 
Hey I need soemthing like that (i don't know if tis the same)
I want to do a sort of fist ring (fight with fist fighting) so before entering they loose everything. With a lever, you pull it and you get teleported to the ring without any of your items, BUT you get 2 new items (for your hands, like gloves or something like that (i'm working on those XD))
I would really apreciate if you help me.
I'm chilean so if anything is written in a wrong way please let me now :D
Thanks.
 
try this
Lua:
local pos = {x=,y=,z=} -- ring position
local itemid,itemid2 = 5516,5513	-- first item, second item
	
function onUse(cid, item, fromPosition, itemEx, toPosition)
	for i = 1, 10 do
		local item = getPlayerSlotItem(cid,i).uid
		if item.uid > 0 then
			doRemoveItem(item.uid)
		end
	end
	doTeleportThing(cid,pos)
	doSendMagicEffect(getThingPos(cid),10)
	doPlayerAddItem(cid,itemid,1)
	doPlayerAddItem(cid,itemid2,1)
	
	
	return doTransformItem(item.uid,(item.itemid == 1945 and 1946 or 1945) )
end
 
I used your script, but I get this error on my server now. This is a separate script.
Code:
[Error - Action Interface] 
data/actions/scripts/quests/zombie.lua:onUse
Description:
not enough memory
 
Back
Top