Fabi Marzan
Well-Known Member
- Joined
- Aug 31, 2020
- Messages
- 135
- Solutions
- 6
- Reaction score
- 67
Hello. I was looking for a way to make Bunshin no Jutsu have up to pk, bunshin no jutsu is like an invocation that copies the username, so is there a way to make it get copied to the pk? if the player has pk.
OTX2
the scripts I use to make them copy my name.
OTX2
the scripts I use to make them copy my name.
Lua:
local function isWalkable(pos)
if getTileThingByPos(pos).itemid == 0 then
return false
end
for i = 0, 255 do
pos.stackpos = i
local tile = getTileThingByPos(pos)
if tile.itemid ~= 0 and not isCreature(tile.uid) then
if hasProperty(tile.uid, 2) or hasProperty(tile.uid, 7) then
return false
end
end
end
return true
end
function onCastSpell(cid, var)
local anyPos, pos = {x = 0, y = 0, z = 0}, getCreaturePosition(cid)
local toPos = {
{x = pos.x + 0, y = pos.y, z = pos.z},
{x = pos.x - 1, y = pos.y, z = pos.z},
{x = pos.x, y = pos.y + 1, z = pos.z},
{x = pos.x, y = pos.y - 1, z = pos.z}
}
local maxSummons = 1
if maxSummons - #getCreatureSummons(cid) > 0 then
for i = 1, maxSummons - #getCreatureSummons(cid) do
if not isWalkable(toPos[i]) then
toPos[i] = pos
end
doCombatAreaHealth(0, 0, anyPos, 0, 0, 0, 255)
doCreateItem(460, 1, anyPos)
local bunshin = doCreateMonster("Clone", anyPos)
doConvinceCreature(cid, bunshin)
setCreatureMaxHealth(bunshin, getCreatureMaxHealth(cid))
doCreatureAddHealth(bunshin, getCreatureHealth(cid))
doSetCreatureOutfit(bunshin, getCreatureOutfit(cid), -1)
setCreatureName(bunshin, getCreatureName(cid), "a " .. getCreatureName(cid))
doTeleportThing(bunshin, toPos[i])
doSendMagicEffect(toPos[i], 1108)
end
else
return false
end
return true
end