• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Script party no attack - WORKS 100% - BUT SEEMS SOME SCREEN FLOODS

Engradiel

Member
Joined
May 3, 2009
Messages
175
Solutions
1
Reaction score
20
Location
Brazil
This is the script for the members of the same party no attack yourselves.

folder of: data/creaturescripts

PHP:
<event type="attack" name="Apt" event="script" value="Apt.lua"/>
<event type="cast" name="Bpt" event="script" value="Bpt.lua"/>
<event type="areacombat" name="Cpt" event="script" value="Cpt.lua"/>
<event type="combat" name="Dpt" event="script" value="Dpt.lua"/>

data/creaturescripts/scripts/login.lua

PHP:
registerCreatureEvent(cid,"Apt")
registerCreatureEvent(cid,"Bpt")
registerCreatureEvent(cid,"Cpt")
registerCreatureEvent(cid,"Dpt")

so Apt, Bpt, Cpt, Dpt ir order script:

PHP:
function onAttack(cid, target)
if isPlayer(cid) and isInParty(cid) and getPlayerParty(cid) == getPlayerParty(target) then
doPlayerSendCancel(cid, "You can not attack your party members")
return false
else
return true
end
end

PHP:
function onCast(cid, target)
if isPlayer(cid) and isInParty(cid) and getPlayerParty(cid) == getPlayerParty(target) then
doPlayerSendCancel(cid, "You can not use spells or runes in your party members")
return false
else
return true
end
end

PHP:
function onAreaCombat(cid, tileItem, tilePosition, isAggressive)
if isPlayer(cid) and isInParty(cid) and getPlayerParty(cid) == getPlayerParty(tileItem) then
return false
else
return true
end
end


PHP:
function onCombat(cid, target)
if isPlayer(cid) and isInParty(cid) and getPlayerParty(cid) == getPlayerParty(target) then
return false
else
return true
end
end

Its a success script and works right (100%) but the screen of my server there are some messages constantly flooding...

On attack:

(LuaGetPlayerParty) player not found....

IT'S flooding my server constantly is possible someone help me?
 
Last edited:
Format your scripts correctly.
Is there more to the error message?
I guess it is related to the onAreaCombat event, try adding and isPlayer(tileItem) after isPlayer(cid) in that file.
 
Back
Top