• 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 help with quest rewards

wishy85

GOD Smokey
Joined
May 10, 2010
Messages
150
Reaction score
3
Location
Australia
Ok im back again lol umm here is my script i got ive just made a new quest and at the end is 6 new weapon items BUT i only want a person to get 1 reward not the whole 6 ok so here is my script i done it work but the player can get all 6 rewards and not 1 so here it is

data\actions\scripts\quests

Lua:
-- hells weapons -- Made By Wishy

function onUse(cid, item, frompos, item2, topos)

   	if item.uid == 2211 then
   		queststatus = getPlayerStorageValue(cid,2211)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a hells rod.")
   			doPlayerAddItem(cid,7735,1)
   			setPlayerStorageValue(cid,2211,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")   		
   		end
		end
   	if item.uid == 2222 then
   		queststatus = getPlayerStorageValue(cid,2222)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a hells wand.")
   			doPlayerAddItem(cid,7735,1)
   			setPlayerStorageValue(cid,2222,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")   		
   		end
		end
   	if item.uid == 2233 then
   		queststatus = getPlayerStorageValue(cid,2233)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a hells club.")
   			doPlayerAddItem(cid,7735,1)
   			setPlayerStorageValue(cid,2233,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")   		
   		end
		end
   	if item.uid == 2244 then
   		queststatus = getPlayerStorageValue(cid,2244)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a hells axe.")
   			doPlayerAddItem(cid,7735,1)
   			setPlayerStorageValue(cid,2244,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")   		
   		end
		end
   	if item.uid == 2255 then
   		queststatus = getPlayerStorageValue(cid,2255)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a hells sword.")
   			doPlayerAddItem(cid,7735,1)
   			setPlayerStorageValue(cid,2255,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")   		
   		end
		end
   	if item.uid == 2266 then
   		queststatus = getPlayerStorageValue(cid,2266)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found a hells slingshot.")
   			doPlayerAddItem(cid,7735,1)
   			setPlayerStorageValue(cid,2266,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")   		
   		end
	else
		return 0
   	end

   	return 1
end


and in data\actions
actions.xml
Lua:
      	<action uniqueid="2211" event="script" value="quests/hells weapons.lua"/>
      	<action uniqueid="2222" event="script" value="quests/hells weapons.lua"/>
      	<action uniqueid="2233" event="script" value="quests/hells weapons.lua"/>
      	<action uniqueid="2244" event="script" value="quests/hells weapons.lua"/>
      	<action uniqueid="2255" event="script" value="quests/hells weapons.lua"/>
      	<action uniqueid="2266" event="script" value="quests/hells weapons.lua"/>

can any1 help me please ????? or wat have i done wrong?
oh with my quest if it helps lol i got a gate of expertise of lvl 250 uid == 1250 if that helps at all hehe.
Im not getting any errors at all i just want the players to get 1 reward per character ...
 
Last edited by a moderator:
I am stupid ._.
Lua:
local t = {
        [2266] = --hells slingshot ID here-- ,
        [2255] = --hells sword ID here-- ,
        [2244] = --hells axe ID here--  ,
        [2233] = -- hells club ID here-- ,
        [2222] = -- hells wand ID here-- ,
        [2211] = -- hells rod ID here-- ,
        s = 12312 
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = t[getItemAttribute(item.uid, 'aid')]
        if getPlayerStorageValue(cid, t.s) == -1 then
                doPlayerAddItem(cid, v, 1)
                doPlayerSendTextMessage(cid, 21, "You received your reward!")
                setPlayerStorageValue(cid, t.s, 1)
        else
                doPlayerSendCancel(cid, "This chest is empty")
        end
return TRUE
end
 
hey last question how to i stop quest chests from moving? like if a player moves the chest it moves how do i fix it plz so u cant move them
 
Back
Top Bottom