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

Lua Support please.

Snakie

New Member
Joined
Apr 15, 2010
Messages
263
Reaction score
4
Im using this script to get my chests work right.

Qeust

local item = 2160 --Reward id
local count = 20 --How many?
local stroage = 22568 --Every quest must have diiferend stroage
function onUse(cid, item, frompos, item2, topos)
queststatus = getPlayerStorageValue(cid,stroage)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a 20 Crystal Coins.")
doPlayerAddItem(cid,item,count)
setPlayerStorageValue(cid,stroage,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return 1
end

action.xml
<action uniqueid="50040" script="20 Crystal Coins.lua" />


When i click on the chest it says you found 20 crystal coins
but i dont recive shit, i tryed almoust evrything, tryed to use chest action id 2000 and unique id 50040 then i tryed with action id 0 and unique 50040 nothing works :(

It says.
[20/07/2010 18:55:51] Description:
[20/07/2010 18:55:51] (luaDoPlayerAddItem) Item not found




Any Sugestions?
 
Last edited:
just make local itemm , not item
Lua:
local itemm = 2160 --Reward id
local count = 20 --How many?
local stroage = 22569 --Every quest must have diiferend stroage
function onUse(cid, item, frompos, item2, topos)
queststatus = getPlayerStorageValue(cid,stroage)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a 20 Crystal Coins.") 
doPlayerAddItem(cid,itemm,count)
setPlayerStorageValue(cid,stroage,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return 1
end
 
My fault sry:
Lua:
local config =
{
stroage = 2250, --Every quest must have diiferend stroage
reward = 2160, --Reward id
count = 20 --How many?
}
function onUse(cid, item, frompos, item2, topos)
queststatus = getPlayerStorageValue(cid,config.stroage)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found a 20 Crystal Coins.")
doPlayerAddItem(cid, config.reward, config.count)
setPlayerStorageValue(cid,config.stroage,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
return TRUE
end
Updated
That works, I tested.
 
Last edited:
Back
Top