KylerXX
Active Member
- Joined
- Jun 24, 2010
- Messages
- 439
- Reaction score
- 30
The function of this script is: There are 12 levers and exists another one that is the lever 13, and if you use all 12 leverrs and you go to the 13 lever you get a reward, but, if you go to lever 13 and you dont use the 12 levers one message informing will be appeared :>
Sorry for bad english.
actions.xml:
i hope you like it :$
Sorry for bad english.
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local storage = 67675 -- Storage to use on levers.
local storagequest = 6667 -- Storage of quest
--actionids 1-12 levers[xxx] .
local aid = {
[5555] = {1},
[5556] = {2},
[5557] = {3},
[5558] = {4},
[5559] = {5},
[5560] = {6},
[5561] = {7},
[5562] = {8},
[5563] = {9},
[5564] = {10},
[5565] = {11},
[5566] = {12}
}
-- Action id 13lever[xxx]--
local oid = {
[5567] = {}
}
local oids = oid[item.actionid]
-- dnt touch
local stors = {[1] = {},[2] = {},[3] = {},[4] = {},[5] = {},
[6] = {},[7] = {},[8] = {},[9] = {},[10] = {},[11] = {},[12] = {}
}
local stor = stors[getPlayerStorageValue(cid, storage)]
local aids = aid[item.actionid]
-----------
--dont touch please :>
if item.itemid > 0 then
if aids then
setPlayerStorageValue(cid, storage, aids[1])
end
end
if item.itemid > 0 then
if oids then
if stor then
if getPlayerStorageValue(cid,storagequest) ~= 1 then
doPlayerAddItem(cid, 2160, 100)
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "You found the 12 levers take your reward: 100 cc.")
setPlayerStorageValue(cid, storagequest, 1)
else
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "You have finished this quest.")
end
else
doPlayerSendTextMessage(cid, TALKTYPE_ORANGE_1, "You need to find all levers!")
end
end
end
return true
end
actions.xml:
Code:
<action actionid="5555;5567" event="script" value="name.lua"/>
i hope you like it :$
Last edited: