I use this to not allow players of the same storage attack each other, when i open the server it says that cannot open the script cause an error on line 9
Code:
local t = {
fireStorage = 15000,
rockStorage = 15002,
natureStorage = 15003,
electrifiedStorage = 15004
}
function onCombat(cid, target)
if isPlayer(cid) and isPlayer(target) then
if getPlayerStorageValue(cid, t.fireStorage) == 1 and getPlayerStorageValue(target, t.fireStorage) == 1 then
return doPlayerSendCancel(cid, "You may not attack your kingdom family.") and false
elseif getPlayerStorageValue(cid, t.rockStorage) == 1 and getPlayerStorageValue(target, t.rockStorage) == 1 then
return doPlayerSendCancel(cid, "You may not attack your kingdom family.") and false
if isPlayer(cid) and isPlayer(target) then
if getPlayerStorageValue(cid, t.natureStorage) == 1 and getPlayerStorageValue(target, t.natureStorage) == 1 then
return doPlayerSendCancel(cid, "You may not attack your kingdom family.") and false
elseif getPlayerStorageValue(cid, t.natureStorage) == 1 and getPlayerStorageValue(target, t.natureStorage) == 1 then
return doPlayerSendCancel(cid, "You may not attack your kingdom family.") and false
end
end
return true
end