• 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] a couple simple scripts.

hellohellohello

New Member
Joined
Nov 28, 2009
Messages
27
Reaction score
0
Hi there,

I'm trying to learn some LUA and it's going okay I guess. Just have a couple of quick requests.

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	getPlayerName(uid)
	if isItemMoveable(itemEx.itemid) == TRUE and isItemRune(itemEx.itemid) == FALSE and isCorpse(itemEx.uid) == FALSE and isContainer(itemEx.uid) == FALSE and isItemStackable(itemEx.itemid) == FALSE and isItemFluidContainer(itemEx.itemid) == FALSE then
		setItemName(itemEx.uid, PLAYER NAMES getItemNameById(itemEx.itemid)
	else
		doPlayerSendCancel(cid, "This item cannot be imbued!")
	end
	return TRUE
end

For this script, I'm trying to make it so you can use a scroll/whatever on an item, and it will 'imbue' the players name onto it so to speak. How can I get it to do so? In game it'll either not work, or the item will look like "getplayernameuid's item".

Secondly, I need some form of generic "place 2 items on tile, 'use' a switch, then the 2 items transform into another". The one that gesior made doesn't fit my needs because I don't want the items to be in a bag, and I don't want the switch to be in the middle, or a lever for that matter. :p I'm not expecting someone to write this whole script, but some pointers on how to do it would be really cool.

Third, a generic "use item x with item y to get item z". I can't really find a good script to use for this.

Aaaaand last but not least -

If I have an item that you use, and it transforms into another item, if I want it to respawn do I simply just have to add a "decayto" on the 2nd item?

Thanks in advance, +rep to those who help.

edit: Forgot to mention I'm going to be using TFS 0.3.5/0.3.6
 
Last edited:
Back
Top