Mateus Robeerto
Excellent OT User
I'm looking for a script, for example "Vip Sorcerer cannot attack 'Master Sorcerer' vocation". Does anyone have this script? Can you share it around here? Thank you in advance.
orLua:function onCombat(cid, target) if not(isPlayer(target)) then return true end if getPlayerGroupId(cid) > 2 then return true end if getPlayerStorageValue(cid, 14136) ~= -1 or getPlayerStorageValue(target, 14136) ~= -1 then return true end local valan1 = getPlayerVocation(cid) > 8 local valan2 = getPlayerVocation(target) > 8 if valan2 ~= valan1 then doPlayerSendCancel(cid, "You can't attack other vocations.") end if valan2 ~= valan1 then return false end return true end
Lua:function onCombat(cid, target) if isInArray({1, 2, 3}, getPlayerVocation(cid)) and isInArray({4, 5, 6}, getPlayerVocation(target)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't attack other vocations.")...
<event type="combat" name="playerattack" script="valan/playerattack.lua"/>
<event type="login" name="playerattacktype" script="valan/playerattacktype.lua"/>
onTargetCombat
event as callback, there is no onCombat
local ec = EventCallback
function ec.onTargetCombat(creature, target)
return RETURNVALUE_NOERROR
end
ec:register()
Here, I have tried several times without success. Can you make a simple script for me?" please!It must be done insideonTargetCombat
event as callback, there is noonCombat
Lua:local ec = EventCallback function ec.onTargetCombat(creature, target) return RETURNVALUE_NOERROR end ec:register()
Here, I have tried several times without success. Can you make a simple script for me?" please!
Show the script u done befor
function onCombat(cid, target)
if not(isPlayer(target)) then
return true
end
if getPlayerGroupId(cid) > 2 then
return true
end
if getPlayerStorageValue(cid, 14136) ~= -1 or getPlayerStorageValue(target, 14136) ~= -1 then
return true
end
local valan1 = getPlayerVocation(cid) > 8
local valan2 = getPlayerVocation(target) > 8
if valan2 ~= valan1 then
doPlayerSendCancel(cid, "You can't attack other vocations.")
end
if valan2 ~= valan1 then
return false
end
return true
end
function onCombat(cid, target)
if isInArray({1, 2, 3}, getPlayerVocation(cid)) and isInArray({4, 5, 6}, getPlayerVocation(target)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't attack other vocations.")
return false
end
return true
end
orLua:function onCombat(cid, target) if not(isPlayer(target)) then return true end if getPlayerGroupId(cid) > 2 then return true end if getPlayerStorageValue(cid, 14136) ~= -1 or getPlayerStorageValue(target, 14136) ~= -1 then return true end local valan1 = getPlayerVocation(cid) > 8 local valan2 = getPlayerVocation(target) > 8 if valan2 ~= valan1 then doPlayerSendCancel(cid, "You can't attack other vocations.") end if valan2 ~= valan1 then return false end return true end
Lua:function onCombat(cid, target) if isInArray({1, 2, 3}, getPlayerVocation(cid)) and isInArray({4, 5, 6}, getPlayerVocation(target)) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You can't attack other vocations.") return false end return true end
local ec = EventCallback
ec.onTargetCombat = function(self, target)
if not self or not self:isPlayer() then
return true
end
if not target or not target:isPlayer() then
return true
end
if self:getVocation():getName() == "Druid" then
if target:getVocation():getName() == "Sorcerer" then
return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE
end
end
return RETURNVALUE_NOERROR
end
ec:register()
Excuse me, which part did you add? Was it in the script or in the creaturescript/script? And what XML are you using?Lua:local ec = EventCallback ec.onTargetCombat = function(self, target) if not self or not self:isPlayer() then return true end if not target or not target:isPlayer() then return true end if self:getVocation():getName() == "Druid" then if target:getVocation():getName() == "Sorcerer" then return RETURNVALUE_YOUMAYNOTATTACKTHISCREATURE end end return RETURNVALUE_NOERROR end ec:register()
View attachment 76706
This script blocks druid to attack sorcerer but sorcerer can attack druids and thats what you wanted?
Thats revscriptExcuse me, which part did you add? Was it in the script or in the creaturescript/script? And what XML are you using?
ok, thank you very much.. the problem is solved!
this is what i needed. My server is totally different from the other OTs, as well as the baiak, RL, global map, etc. My map is based on The Lord of the Rings, in the old version 7.92. I already marked you as a solution. Thank's for your time.Is it the script u needed?
If u want it different then let me know it.
Mark the script as "solution"