Hello.
Script is when you press the lever we buy a item but not as what we want just a random item.
Data/actions/script/NAME_SCRIPTS.lua
Data/actions.xml
Script is when you press the lever we buy a item but not as what we want just a random item.
Data/actions/script/NAME_SCRIPTS.lua
PHP:
function onUse(cid, item, frompos, item2, topos)
local item = {
id = 2130, -- id1 itemka
id2 = XXXX, -- id2 itemka
id3 = XXXX -- id3 itemka
}
local money = 4000
local rand = math.random(1, #item)
if item.itemid == 1945 then
if(doPlayerRemoveMoney(cid, money) == TRUE) then
doPlayerAddItem(cid, item[rand])
doPlayerSendTextMessage(cid, 22, "Brought ".. item.name ..".")
elseif item.itemid == 1946 then
if(doPlayerRemoveMoney(cid, money) == TRUE) then
doPlayerAddItem(cid, item[rand])
doPlayerSendTextMessage(cid, 22, "Brought ".. item.name ..".")
end
end
end
return TRUE
end
Data/actions.xml
PHP:
<action uniqueid="1234" event="script" value="NAME_SCRIPTS.lua"/>
Last edited: