• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

MoveEvent Remove vials on throw on the floor

Azi

Banned User
Joined
Aug 12, 2007
Messages
1,167
Reaction score
53
Location
Włocławek
A simple script that will remove empty flasks thrown by players on the ground. : )
Script works in protection zone too, if you want disable it in pz; before doRemoveItem[...] add :
PHP:
	if(getTilePzInfo(position))then 
		return TRUE
	end
data/movements/flasks.lua
PHP:
function onAddItem(moveitem, tileitem, position, cid)
	if not(tileitem) or not(moveitem) then
		return TRUE
	end
	doRemoveItem(moveitem.uid, moveitem.type)
	return true
end
movements.xml
PHP:
<movevent type="AddItem" itemid="7636;7635;7634" event="script" value="flasks.lua"/>

Now you don't have many flask shit's on the ground everywhere. ; d
 
Or can't you make it so when you use the potion, it removes itself?
It's a nice contribution, but somewhat useless for this situation. Can be useful for other things such as parcels/labels.
 
Or can't you make it so when you use the potion, it removes itself?
It's a nice contribution, but somewhat useless for this situation. Can be useful for other things such as parcels/labels.
you can add anything, only put id here: itemid="7636;7635;7634" but, you can sell vials on otservs, for low lvls...
 
Add the next .... is possible=
if(getConfigValue("cleanVialsinMap")) then

Code:
local cleanItemsInMap = getBooleanFromString(getConfigValue('cleanItemsInMap'))

function onAddItem(moveitem, tileitem, position, cid)
    if(cleanItemsInMap) then
        if not(tileitem) or not(moveitem) then
            return true
        end

        if(getTilePzInfo(position))then 
            return true
        end

        doRemoveItem(moveitem.uid, moveitem.type)
        return true
    end
end
 
Last edited:
i don't understand you ingerention config into script, this script is not preinstalled in TFS and no need it and if someone need it - installing it, no need to make changes in config.lua you need to be kool? nub. ; D
 
cleanItemsInMap no require define into code ...
only set cleanItemsInMap = false or true
in config.lua

local cleanItemsInMap = getBooleanFromString(getConfigValue('cleanItemsInMap'))
Define at function
 
Back
Top