• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Attack a pk player and get pz

bobmateus

New Member
Joined
Aug 7, 2012
Messages
15
Reaction score
0
Hello, i want to know if is possible when a player attacks another player pk with certain spell, this receive pz ?
 
If it is aggressive, then they will receive pz by default.

I want he receives pz even if he attack a player pk.
The script is it:
function onCastSpell(cid, var)

local function doSend(pos1, pos2, num)
doSendDistanceShoot(getCreaturePosition(pos1), getCreaturePosition(pos2), 35)
doSendDistanceShoot(getCreaturePosition(pos2), getCreaturePosition(pos1), 35)
if type(num) == "number" and num == 1 then
if math.random(1, 100) <= config.chance then
local pp1 = getCreaturePosition(pos1)
local pp2 = getCreaturePosition(pos2)
doTeleportThing(pos2, pp1)
doTeleportThing(pos1, pp2)
else
doPlayerSendCancel(cid, "Opps que azar, tente denovo!")
end
end
return true
end

local target = getCreatureTarget(cid)

if type(target) ~= "number" or target == 0 then
doPlayerSendCancel(cid, "Você precisa selecionar alguma creature para fazer isso!")
return false
end

if (config.player == false and isPlayer(target)) or (isPlayer(target) and getPlayerAccess(target) > getPlayerAccess(cid)) or (config.monster == false and isMonster(target)) or (config.npc == false and isNpc(target)) then
doPlayerSendCancel(cid, "Voce nao pode fazer isso com essa criatura!")
return false
end

if getPlayerStorageValue(cid, config.storage) > os.time() then
doPlayerSendCancel(cid, "Voce so pode utilizar essa magia a cada 2 minutos!")
return false
else
for i = 1, 7 do
addEvent(doSend, i*250, cid, target, 0)
end
addEvent(doSend, 4*500, cid, target, 1)
setPlayerStorageValue(cid, config.storage, os.time() + config.time)
end

return true
end
 
Back
Top