Ghazer
Member
- Joined
- Mar 13, 2009
- Messages
- 350
- Reaction score
- 6
I create that script, script give magic level on use quest depends of your vocation... but that not work
whats wrong?
Extra: I dont create this script I only edit to add magic level but not work :S
anyone can help me?
whats wrong?
LUA:
local cfg = {
questChestAId = 2999, -- if you want to make another quest chest like this one, make a copy of this file, rename it and change this aid to something else. --
questChestStorage = 45568 -- if you have made a copy of this file and has changed the aid make sure you change the storage too, storage must be an unused storage.--
}
local vocQ = {
[1] = {maglvl = 60}, -- specify the item that you want to give.--
[2] = {maglvlm = 60}, -- vocations are as follows: 1 = sorcerer, 2 = druid, 3 = paladin, 4 = knight.--
[3] = {maglvl = 20},
[4] = {maglvl = 9}
}
function onUse(cid, maglvl, toPosition, itemEx, fromPosition)
for voc, i in pairs(vocQ) do
if maglvl.actionid == cfg.questChestAId then
local opened = getPlayerStorageValue(cid, cfg.questChestStorage)
if opened == -1 then
doPlayerSetStorageValue(cid, cfg.questChestStorage, 1)
if getPlayerVocation(cid) == voc or getPlayerVocation(cid) == voc+4 then
doPlayerAddMagLevel(cid, i.maglvl)
doPlayerSendTextMessage(cid, 25, "You recieved magic level 60")
end
else
doPlayerSendCancel(cid, "You have already recieved your magic level.")
end
end
end
return true
end
Extra: I dont create this script I only edit to add magic level but not work :S
anyone can help me?