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

3 questions!!

Amiroslo

Excellent OT User
Joined
Jul 28, 2009
Messages
6,812
Solutions
6
Reaction score
822
hi,i have 3 questions!!

1-how do i make a chest that i put it in temple so just ho begin the game now can take it and just one time

2-i want to make an item that dont move,how?

3-how to make a lever when u press on it u get something??
 
1 -- add action id 2000 and then the item id on unqiue id

2 --

3 -- First of all you need a script that decide what item you will get ect, and then you will ned to add a action id to the levler
 
can u do the scripts to me?
not now, sry. im not at my main computer :/

here they are!

1. action id 2000 unique id of the item and use the black boxes put there all the items u want for the players

2. dont know

3.
TFS\data\actions\runes
LUA:
 <action actionid="1000;1001;1002;1003;1004;1005;1006;1007;1009;1010;1011;1012;1013;1014" event="script" value="runes.lua"/>

TFS\data\actions\scripts\runes
LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local shop = {
		[1000] = {
			id = 2268, container = 2003, cost = 50000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1001] = {
			id = 2273, container = 2002, cost = 30000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1002] = {
			id = 2304, container = 2000, cost = 50000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1003] = {
			id = 2313, container = 2001, cost = 50000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1004] = {
			id = 2280, container = 1995, cost = 30000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1005] = {
			id = 2173, container = 1994, cost = 80000, effect = CONST_ME_GIFT_WRAPS
		},
		[1006] = {
			id = 2268, container = 2003, cost = 100000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1007] = {
			id = 2273, container = 2002, cost = 100000,charges = 100, effect =  CONST_ME_GIFT_WRAPS
		},
		[1014] = {
			id = 2173, container = 1994, cost = 80000, effect = CONST_ME_GIFT_WRAPS
		},
		[1009] = {
			id = 2280, container = 1995, cost = 100000, effect = CONST_ME_GIFT_WRAPS
		},
		[1010] = {
			id = 7850, container = 3940, cost = 100000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1011] = {
			id = 7838, container = 3940, cost = 100000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1012] = {
			id = 7839, container = 3940, cost = 100000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		},
		[1013] = {
			id = 7363, container = 3940, cost = 100000, charges = 100, effect = CONST_ME_GIFT_WRAPS
		}
	}
	local v = shop[item.actionid]
	local weight = getItemWeightById(v.id, tonumber(getItemInfo(v.container).maxItems)) + getItemWeightById(v.container, 1)
	if(getPlayerFreeCap(cid) >= weight) then
		if(getPlayerMoney(cid) >= v.cost) then
			local bp = doCreateItemEx(cid, v.container, 1)
			if(doPlayerAddItemEx(cid, bp) ~= RETURNVALUE_NOERROR) then
				doPlayerSendCancel(cid, "Sorry, you do not have enough space.")
			else
				for i = 1, tonumber(getItemInfo(v.container).maxItems) do
					doAddContainerItem(bp, v.id, v.charges or 1)
				end
				doPlayerRemoveMoney(cid, v.cost)
				doSendMagicEffect(getThingPos(cid), v.effect)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have purchased a backpack of " .. getItemInfo(v.id).plural .. ".")
			end
		else
			doPlayerSendCancel(cid, "Sorry, you must have " .. v.cost .. " gold.")
		end
	else
		doPlayerSendCancel(cid, "Sorry, you need " .. weight:format("%.2f") .. " oz. to carry this container of " .. getItemInfo(v.id).plural .. ".")
	end
	return doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
end

i use this for my server in VIP-zone like how this script is now it gives a full container with all runes like UH or SD or what else all with 100 charges..

Goodluck with it! :thumbup:
 
Back
Top