Por favor, ayudar a dónde va el id del elemento y la cantidad que tiene que dar.
Please help where the id of the item goes and how much it has to give.
[= Código Lua] locales de Moneda = 2160
locales de recuento = 50
Función onUse (Jugador, Elemento, fromPosition, Objetivo, toPosition, isHotkey)
si no Jugador: removeItem (monedas, Contar) una Continuación,
volver article: Transformar (TEMA: getId () == 1945 y 1946 o 1945)
aleta
locales newCount = Jugador: getItemCount (monedas)
locales msg = ( "Ahora Tiene% d% s% s de la moneda"): Formato (newCount, itemtype (monedas): getName (), newCount> 1 y "s" o "")
Jugador: sendTextMessage (MESSAGE_INFO_DESCR, msg)
volver article: Transformar (TEMA: getId () == 1945 y 1946 o 1945)
fin [/ code]
itemp is 16101 quantity 1
here look
local coin = 2160
local count = 50
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not player:removeItem(coin, count) then
return item:transform(item:getId() ==16101, 1 and 1946 or 1945)
end
local newCount = player:getItemCount(coin)
local msg = ("You now have %d %s coin%s"):format(newCount, ItemType(coin):getName(), newCount > 1 and "s" or "")
player:sendTextMessage(MESSAGE_INFO_DESCR, msg)
return item:transform(item:getId() ==16101, 1 and 1946 or 1945)
end
Discount the money but not the item
My problem is here and this is an important part of my server I hope someone helps me deduct the object but does not measure anything
help please
LUA:
local coin = 2160
local count = 50
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if not player:removeItem(coin, count) then
return item:transform(item:getId() ==16101, 1 and 1946 or 1945)
end
local newCount = player:getItemCount(coin)
local msg = ("You now have %d %s coin%s"):format(newCount, ItemType(coin):getName(), newCount > 1 and "s" or "")
player:sendTextMessage(MESSAGE_INFO_DESCR, msg)
return item:transform(item:getId() ==16101, 1 and 1946 or 1945)
end
LUA:
<action actionid="23478" script="Edited/Palancas V1.lua"/>
bump please help!