brunolopes
New Member
- Joined
- Nov 8, 2009
- Messages
- 49
- Reaction score
- 1
Can someone help me?
I was making a "advanced convince" for my server with tables, for example:
But when I use a in pairs function, the script compares all the monster names with the target.
So the script convinces the creature and sends the player's cancel.
How I can fix this?
I was making a "advanced convince" for my server with tables, for example:
Code:
local bribes = {
["Rat"] = {
money = 5,
item = "Cheese",
chances = {1, 100000}
},
["Demon"] = {
money = 100000,
item = "Demon Shield",
chances = {80000, 5000}
}
}
But when I use a in pairs function, the script compares all the monster names with the target.
Code:
local target = getCreatureTarget(cid)
for m, n in pairs(bribes) do
if(getCreatureName(target) == m) then
doConvinceCreature(cid, target)
else
doPlayerSendCancel(cid, "This is not a bribeable creature")
end
end
So the script convinces the creature and sends the player's cancel.
How I can fix this?