Can help me on this script plizzz.
I need the pet who did not atack to summon.
He Atack me all times ;/.
Script:data/talkactions/scripts
function doPlayerAddSummon(cid, name, pos)
local creature = doSummonCreature(name, pos)
doConvinceCreature(cid, creature)
return creature
end
function onSay(cid, words, param)
local petUid = 0
local pos = getCreaturePosition(cid)
local store = getPlayerStorageValue(cid, 1000)
if words == "!pet" then
if store == -1 then
if getTilePzInfo(pos) == FALSE then
petUid = doPlayerAddSummon(cid, "Pet", pos)
setPlayerStorageValue(cid, 1000, petUid)
else
doPlayerSendCancel(cid, "You can not call your pet in a protection zone.")
end
else
if isCreature(store) == TRUE then
doRemoveCreature(store)
setPlayerStorageValue(cid, 1000, 0)
else
if getTilePzInfo(pos) == false then
petUid = doPlayerAddSummon(cid, "Pet", pos)
setPlayerStorageValue(cid, 1000, petUid)
else
doPlayerSendCancel(cid, "You can not call your pet in a protection zone.")
end
end
end
end
end
I need the pet who did not atack to summon.
He Atack me all times ;/.
Script:data/talkactions/scripts
function doPlayerAddSummon(cid, name, pos)
local creature = doSummonCreature(name, pos)
doConvinceCreature(cid, creature)
return creature
end
function onSay(cid, words, param)
local petUid = 0
local pos = getCreaturePosition(cid)
local store = getPlayerStorageValue(cid, 1000)
if words == "!pet" then
if store == -1 then
if getTilePzInfo(pos) == FALSE then
petUid = doPlayerAddSummon(cid, "Pet", pos)
setPlayerStorageValue(cid, 1000, petUid)
else
doPlayerSendCancel(cid, "You can not call your pet in a protection zone.")
end
else
if isCreature(store) == TRUE then
doRemoveCreature(store)
setPlayerStorageValue(cid, 1000, 0)
else
if getTilePzInfo(pos) == false then
petUid = doPlayerAddSummon(cid, "Pet", pos)
setPlayerStorageValue(cid, 1000, petUid)
else
doPlayerSendCancel(cid, "You can not call your pet in a protection zone.")
end
end
end
end
end