Yaze
Well-Known Member
- Joined
- Sep 15, 2014
- Messages
- 382
- Reaction score
- 61
Hello, as the topic says,
i would like to upgrade this script that i got.
I would like it to have that it costs some money (id :2160) , and also it should be able to add few more monsters that should spawn. I am using tfs 0.3.6
i would like to upgrade this script that i got.
I would like it to have that it costs some money (id :2160) , and also it should be able to add few more monsters that should spawn. I am using tfs 0.3.6
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local fromPos = {x = toPosition.x - 10, y = toPosition.y - 10, z = toPosition.z}
local toPos = {x = toPosition.x + 10, y = toPosition.y + 10, z = toPosition.z}
local amount = 0
for x = fromPos.x, toPos.x do
for y = fromPos.y, toPos.y do
for z = fromPos.z, toPos.z do
local monster = getTopCreature({x=x,y=y,z=z}).uid
if(isCreature(monster) == TRUE) then
if getCreatureName(monster) == "Phantom Lord" then
amount = amount+2
end
end
end
end
end
if amount >= 2 then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
doPlayerSendCancel(cid, "You need to kill Phantom Lord first before you can summen one again.")
return true
else
doSummonCreature("Phantom Lord", {x = toPosition.x - 1, y = toPosition.y + 1, z = toPosition.z})
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have summened Phantom Lord.")
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
return true
end