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

Talkaction

andrew95434

Banned User
Joined
May 6, 2010
Messages
86
Reaction score
0
Location
chile
I want to do a talkaction to remove an item you have and add another (such as transforming. Help me with that please
 
Lua:
local removeItem = 9971 --Item to be removed
local addItem = 2160    --Item to be added

function onSay(cid, words, param)	
	if getPlayerItemCount(cid, removeItem) >= 1 then
		doPlayerRemoveItem(cid, removeItem, 1)
		doPlayerAddItem(cid, addItem, 1)
	end
end
 
Code:
<talkaction words="!item" event="script" value="additem.lua"/>

(Save the file as additem.lua and save it in data/talkactions/scripts
 
Code:
local items = {9971, 500, 3532}
function onSay(cid, words, param, channel)
	local f
	for i = 1, #items do
		if getPlayerItemCount(cid, items[i]) > 0 then
			doPlayerRemoveItem(cid, items[i], 1)
			f = true
		else
			doPlayerSendTextMessage(cid, 27, "You dont have the required items.")
			break
		end
	end
	if f == true then doPlayerAddItem(cid, 2160, 1) end
	return true
end
 
if i want that it works only if you have a certain storage i put this?:

local items = {9971, 500, 3532}
function onSay(cid, words, param, channel)
if getPlayerStorageValue(cid,3000) == 1 then
local f
for i = 1, #items do
if getPlayerItemCount(cid, items) > 0 then
doPlayerRemoveItem(cid, items, 1)
f = true
else
doPlayerSendTextMessage(cid, 27, "You dont have the required items.")
break
end
end
if f == true then doPlayerAddItem(cid, 2160, 1) end
return true
end
 
taking advantage of you are online can you help me with otrestarter?
i put it into my server folder but when i open it, it doesnt work

I have to do anything besides copy it to my server folder?
 
Back
Top