FilipeJF
New Member
- Joined
- Jan 9, 2012
- Messages
- 124
- Reaction score
- 4
Looks like there's a bug in this script where you have to kill 10 trolls. But theres a bug in the storages there.
Let me explain.
I was with the storage value in "18". My friend was with it in 19 (where you are supposed to start killing the trolls). I needed to talk with an NPC to receive value 19, but as my friend killed a Troll in front of me, my storage value leveled to 19, and I lost the chance to talk with the NPC. Is there a way to make the kill count ONLY for those who have value 19 even if they're in a party?
Let me explain.
I was with the storage value in "18". My friend was with it in 19 (where you are supposed to start killing the trolls). I needed to talk with an NPC to receive value 19, but as my friend killed a Troll in front of me, my storage value leveled to 19, and I lost the chance to talk with the NPC. Is there a way to make the kill count ONLY for those who have value 19 even if they're in a party?
Lua:
function onDeath(cid, corpse, killer)
local monstName = "Troll"
local Storage = 102501
local valor1 = 19
local valor2 = 28
if isMonster(cid) and string.lower(getCreatureName(cid)) == string.lower(monstName) and getPlayerStorageValue(killer[1], Storage) >= valor1 and getPlayerStorageValue(killer[1], Storage) <= valor2 then
doPlayerSendTextMessage(killer[1], 22, "Your questlog has been updated.")
if isInParty(killer[1]) == TRUE then
local players = getPartyMembers(getPartyLeader(killer[1]))
for i, k in ipairs(players) do
setPlayerStorageValue(k, Storage, (getPlayerStorageValue(k, Storage)+1))
end
else
setPlayerStorageValue(killer[1], Storage, (getPlayerStorageValue(killer[1], Storage)+1))
end
end
return true
end