• 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 Quest Chest's

Fiskbullen

Jumpstylaaa! Sweden (Y)
Joined
Mar 26, 2009
Messages
146
Reaction score
1
Location
Sweden, Skara
Hello Otlander's, i think this topic has been up before but i didn't found it!

Need a script to a chest in a quest, like when you press the chest you gonna get the item "xxxx" what do i need to put in my .lua file?

/regard Me!
 
Set uid of chest, then..

chest.lua
Lua:
function onUse(cid, item, frompos, item2, topos)


if item.uid == 12345 then ----------Any UID here
if getPlayerStorageValue(cid,12345) == -1 then ----------Same UID here
doPlayerSendTextMessage(cid,25,"You have found a blue dildo.")
doPlayerAddItem(cid,1234,1) ----------Whatever itemID here
setPlayerStorageValue(cid,12345,1) ----------Same UID here
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end

end
return TRUE
end
 
There's easier way actually.
Go to RME, put chest on map, set Action ID = 2000, Unique ID = some random in range 1000-65535 that's not in use, put items as chest content.
 
thanks all!
Someone online hwo can help me with lever? i wanna buy sd, but my script does not work

local config = {
item = {2268,1}
cost = {10000,
}-- config end --

function onUse(cid, item, fromPosition, itemEx, toPosition)
if doPlayerRemoveMoney(cid, config.cost) == TRUE then
doPlayerAddItem(cid, config.item[1], config.item[2])
doPlayerSendTextMessae(cid, 18, "You bought "..config.item[2].."x "..getItemNameById(config.item[1]).." for "..config.cost.." gold coins.")
else
doPlayerSendTextMessae(cid, 18, "You need "..config.cost.." gold coins for "..config.item[2].."x "..getItemNameById(config.item[1])..".")
return TRUE
end
 
thanks all!
Someone online hwo can help me with lever? i wanna buy sd, but my script does not work

local config = {
item = {2268,1}
cost = {10000,
}-- config end --

Lua:
local config = {
	item = {2268,1}, 
	cost = {10000}
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if doPlayerRemoveMoney(cid, config.cost) == TRUE then
		doPlayerAddItem(cid, config.item[1], config.item[2])
		doPlayerSendTextMessage(cid, 18, "You bought "..config.item[2].."x "..getItemNameById(config.item[1]).." for "..config.cost*config.item[2].." gold coins.")
	else
		doPlayerSendTextMessage(cid, 18, "You need "..config.cost*config.item[2].." gold coins for "..config.item[2].."x "..getItemNameById(config.item[1])..".")
	end	
return TRUE
end
 
quick combination of _Arthur's chest script and Fiskbullen's config.

Here you only need to edit config:
Lua:
function onUse(cid, item, frompos, item2, topos)
 
local config = {
UID = 1234 ----------Any UID here
ITEM = {2160,5} ---- itemid and itemcount In this sample 5 crystal coins
MSG = "You have found some weird stuff..." --- message to send
}-- config end --

if item.uid == config.UID then 
if getPlayerStorageValue(cid,config.UID) == -1 then
doPlayerSendTextMessage(cid,25,config.MSG)
doPlayerAddItem(cid, config.ITEM)
setPlayerStorageValue(cid,config.UID,1)
else
doPlayerSendTextMessage(cid,25,"The chest is empty.")
end
 
end
return TRUE
end
 
Back
Top