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

[Request/Support] [TFS] Actionscripts

DawidXT

New Member
Joined
Jan 29, 2009
Messages
9
Reaction score
0
I have two scripts I want to make. First is to have table or coal basin or something where a player can only set a certain type of item on top of it. (E.g if item is magic plate armor it can be put on top. If not "Sorry Not Possible")

Second script is to make an NPC use the /attr command to edit objects infront of him if the player has paid money. Any idea how I can do this? Thanks
 
Here you are try it:

PHP:
local items = {2465, 2466}
local posItem = {x=98, y=132, z= 7}
function onAddItem(moveitem, tileitem, position)
	if isInArray(items, moveitem.itemid) == TRUE then
	if getItemArmor(moveitem.uid) >= 10 then
		doSendMagicEffect(position, CONST_ME_HITBYFIRE)
	else
		doTeleportThing(moveitem.uid, posItem, TRUE)
	end
	else
	doTeleportThing(moveitem.uid, posItem, TRUE)
	end
	return TRUE
end

In your .xml:
PHP:
<movevent event="AddItem" tileitem="1" itemid="1485" script="basin.lua"/>

How it works?
Ok, you need to add items in here:
local items = {2465, 2466}
posItem is where the item will be teleported if coal basin reject the item..
And:
getItemArmor(moveitem.uid) >= 10
If get the move item armor more than 10 or higher if not reject item to posItem.

Rep!
 
if i return FALSE nothing will happen :/, he just whant to moveitem from coal basin if the item has not the required options..

If you know a better idea to move the moveitem.itemid like moveitem.x+1 or something it will be great!
 
I have two scripts I want to make. First is to have table or coal basin or something where a player can only set a certain type of item on top of it. (E.g if item is magic plate armor it can be put on top. If not "Sorry Not Possible")

Second script is to make an NPC use the /attr command to edit objects infront of him if the player has paid money. Any idea how I can do this? Thanks

if i return FALSE nothing will happen :/, he just whant to moveitem from coal basin if the item has not the required options..

If you know a better idea to move the moveitem.itemid like moveitem.x+1 or something it will be great!

return FALSE will do what he wants.
 
Back
Top