• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Help me!

Niioxce

Otland lurker
Joined
Jun 22, 2012
Messages
324
Reaction score
4
Location
Sweden
Hey, I want a script where you can write "!update" and update your "EX. donate wand too donate bow AND donate arrow.." so it removes donate wand and recives Donate arrow AND donate bow, i know it sounds confusing but i've seen it before on other ot's.. so im beging for a script like that... hope you understand THANKS! :p
 
YES!, but player lose donor wand and gets donor bow and arrow xD almost right!! And so they only who have the donor wand can only say !update. still looking for the script!

- - - Updated - - -

Someone help?!

- - - Updated - - -

HELP?!

- - - Updated - - -

Please? :,(
 
Last edited:
Try this script out:

!exchange "wand

talkactions.xml

XML:
<talkaction words="!exchange" event="script" value="script.lua"/>
script.lua

LUA:
local config = {
	storage = 12234 -- The storage of VIP players
}
 
local t = {
	["wand"] = {
		items = {
			{7735, 1}
		},
		newItems = {
			{2456, 1}, 
			{7839, 100}
		}
	}
}
 
function onSay(cid, words, param, channel)
	local v, removeItems = t[param], 0
	if(param == "") then
		doPlayerSendCancel(cid, "Command requires param.")
		return true
	end
 
	if(getPlayerStorageValue(cid, config.storage) > 0) then
		for i = 1, #v.items do
			if(getPlayerItemCount(cid, v.items[i][1]) >= v.items[i][2]) then
				removeItems = removeItems + 1
			end
		end
 
		if(removeItems ~= #v.items) then
			for i = 1, #v.items do
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need " .. v.items[i][2] .. "x " .. getItemNameById(v.items[i][1]) .. " for the exchange.")
			end
		else
			for k = 1, #v.newItems do
				local id = doCreateItemEx(v.newItems[k][1], v.newItems[k][2])
				if(doPlayerAddItemEx(cid, id, false) ~= RETURNVALUE_NOERROR) then
					return doPlayerSendCancel(cid, "You cannot carry the new items."), false
				end
			end
			for i = 1, #v.items do
				doPlayerRemoveItem(cid, v.items[i][1], v.items[i][2] or 1)
			end
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
			doCreatureSay(cid, "Congratulations! You have made an exchange.", TALKTYPE_ORANGE_1)
		end
	end
	return true
end
 
Last edited:
Try this script out:



talkactions.xml

XML:
<talkaction words="!exchange" event="script" value="script.lua"/>
script.lua

LUA:
local config = {
	storage = 12234 -- The storage of VIP players
}

local t = {
	["bow"] = {
		items = { -- this is the bow you remove for the new items
			{2148, 1}, -- {BOW ITEM ID, COUNT}
		},
		newItems = { -- these are the items received for trading the bow
			{2160, 1}, -- {NEW_ITEM_ID, COUNT}
			{2152, 10},
		}
	},
	["wand"] = {
		items = {
			{2148, 1},
		},
		newItems = {
			{2160, 1}, 
			{2152, 10},
		}
	},
}

function onSay(cid, words, param, channel)
	local v, removeItems = t[param], 0
	
	if(param == "") then
		doPlayerSendCancel(cid, "Command requires param.")
		return true
	end
	
	if(getPlayerStorageValue(cid, config.storage) > 0) then
		for i = 1, #v.items do
			if(getPlayerItemCount(cid, v.items[i][1]) >= v.items[i][2]) then
				removeItems = removeItems + 1
			end
		end
		if(removeItems ~= #v.items) then
			for i = 1, #v.items do
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need " .. v.items[i][2] .. "x " .. getItemNameById(v.items[i][1]) .. " for the exchange.")
			end
		else
			for k = 1, #v.newItems do
				local id = doCreateItemEx(v.newItems[k][1], v.newItems[k][2])
				if(doPlayerAddItemEx(cid, id, false) ~= RETURNVALUE_NOERROR) then
					return doPlayerSendCancel(cid, "You cannot carry the new items."), false
				end
			end
			for i = 1, #v.items do
				doPlayerRemoveItem(cid, v.items[i][1], v.items[i][2] or 1)
			end
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
			doCreatureSay(cid, "Congratulations! You have made an exchange.", TALKTYPE_ORANGE_1)
		end
	end
	return true
end

How do i configurate it?! 'sorry i dont know if that's a word xD
 
How do i configurate it?! 'sorry i dont know if that's a word xD

Code:
	["wand"] = {
		items = {
			{[COLOR="#FF0000"]2148[/COLOR], [COLOR="#0000FF"]1[/COLOR]},
		},
		newItems = {
			{[COLOR="#FF8C00"]2160[/COLOR], [COLOR="#0000FF"]1[/COLOR]}, 
			{[COLOR="#FF8C00"]2152[/COLOR], [COLOR="#0000FF"]10[/COLOR]},
		}
	},
Red = Wand itemID
Orange = Item ID's of the new items
Blue = Count of the items (how many)

You replace the wand for the new items. That's what you wanted, right?
 
Nvm, but i want to get Bow and arrow, and remove the wand xD is that the script?

- - - Updated - - -

Code:
	["wand"] = {
		items = {
			{[COLOR="#FF0000"]2148[/COLOR], [COLOR="#0000FF"]1[/COLOR]},
		},
		newItems = {
			{[COLOR="#FF8C00"]2160[/COLOR], [COLOR="#0000FF"]1[/COLOR]}, 
			{[COLOR="#FF8C00"]2152[/COLOR], [COLOR="#0000FF"]10[/COLOR]},
		}
	},
Red = Wand itemID
Orange = Item ID's of the new items
Blue = Count of the items (how many)

You replace the wand for the new items. That's what you wanted, right?

AHA! xD
Code:
		newItems = {
			{2160, 1}, 
			{2152, 10},
		}

so there i choose bow and arrow? :D
 
Yeah. You can put the bow's ID where "2160" is. Then put arrow ID where the "2152" is.
So i should change it on Bow and wand? xD Sorry if im being Annoying or something but i want to learn D: ^^ Just tell me if im that annoying. xD
Code:
	["bow"] = {
		items = { -- this is the bow you remove for the new items
			{2148, 1}, -- {BOW ITEM ID, COUNT}
		},
		newItems = { -- these are the items received for trading the bow
			{2160, 1}, -- {NEW_ITEM_ID, COUNT}
			{2152, 10},
		}
	},
	["wand"] = {
		items = {
			{2148, 1},
		},
		newItems = {
			{2160, 1}, 
			{2152, 10},
		}
	},
 
No, I only put the bow and wand there so you can see how to add more items. You don't need to edit both.

Just change the wand items and then say !exchange "wand" in the game and it should take your wand and give you new items.

Nothing happends D:
 
Back
Top