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

tp items to dustbin, npc sends u to npc

otuserbyme

New Member
Joined
Nov 10, 2011
Messages
54
Reaction score
1
:huh:
1. I am trying to figure out how to keep players from throwing trash in a certain area.It is a room on floor 7 and players can only view items in it from a balcony around the room that is located on floor 6.Is there a way to make items that players throw in the "veiwable" area of floor 6 to be teleported to a dustbin so it wont appear on the items in the room on floor 7 ?

2.I am tryin to get npc 1 to send a player to npc 2.Npc 2 cant cant speak to player unless npc 1 sends him.

Hope my descriptions were accurate enough and thanks for any help offered :)
 
:huh:
1. I am trying to figure out how to keep players from throwing trash in a certain area.It is a room on floor 7 and players can only view items in it from a balcony around the room that is located on floor 6.Is there a way to make items that players throw in the "veiwable" area of floor 6 to be teleported to a dustbin so it wont appear on the items in the room on floor 7 ?

2.I am tryin to get npc 1 to send a player to npc 2.Npc 2 cant cant speak to player unless npc 1 sends him.

Hope my descriptions were accurate enough and thanks for any help offered :)

1.
Sorry, I don't know how to do it... But you have a nice idea, I'll try to make it, and if I figure out how, i'll let you know...

2.
I don't know what you mean by "send", if it should be like a teleport you could use this:
Lua:
doTeleportThing(cid, {x=z,y=y,z=z})
this simple...

And to be able to talk to the npc only if you have talked to the one before, add a storage value to the player when he talks to the first npc, and then make the second npc check it, like this:
first npc:
Lua:
setPlayerStorageValue(cid, value, 1)
second npc:
Lua:
if getPlayerStorageValue(cid, value) == TRUE then

Hope it helps
any questions just ask =)
 
any luck with the trash thingy? ;p

Not lucky so far...
I'm trying something with the function onAddItem...
Ill let you know, it really got me thinking, probably it is simpler than I'm thinking...


--- EDIT

I gave up trying to make it on my own...
But, I found this on the web... -- IT IS NOT MINE -- the script was made by mc-pero
It is really simple... I was overthinking it...
I didn't test it though, let me know if it works..

go to movements/scripts and create a .lua file named itemremover
Lua:
function onAddItem(item, tileItem, pos)
	setGlobalStorageValue(6000, 2)
	return TRUE
end
 
function onRemoveItem(item, tileItem, pos)
	pos.stackpos = 1
	if(getThingfromPos(pos).uid ~= 0) then
		return TRUE
	end
 
	setGlobalStorageValue(6000, 1)
	return TRUE
end
then go to movements.xml and add this:

Lua:
	<movevent event="AddItem" fromid="1602" toid="7463" tileitem="1" script="itemremover.lua"/>
	<movevent event="RemoveItem" fromid="1602" toid="7463" tileitem="1" script="itemremover.lua"/>

It will remove every item from id 1602 to id 7463.. you can change it to whatever you want..

Hope it helps = )
 
Last edited:
Yes that helped me figure things out and it seems to work, no errors so far, so thanks again.... also sorry for the delay in answer as I was working long hours for last week ;)
 
Back
Top