• 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!

Need max summon on this spell

Joined
Apr 11, 2015
Messages
106
Reaction score
6
function onCastSpell(cid, var)
local dir = getPlayerLookDir(cid)
local pos = getPlayerPosition(cid)

if(dir==1)then
pos.x = pos.x + 1
elseif(dir==2)then
pos.y = pos.y + 1
elseif(dir==3)then
pos.x = pos.x - 1
elseif(dir==0)then
pos.y = pos.y - 1
end
doConvinceCreature(cid, doCreateMonster("Tiger", pos))
return true
end
 
Code:
local maxSummon = 1

function onCastSpell(cid, var)
    local playerDirection = getPlayerLookDir(cid)
    local playerPosition = getPlayerPosition(cid)
   
    if #getCreatureSummons(cid) == maxSummon then
        doPlayerSendCancel(cid, "You cannot have more than ".. maxSummon ..".")
        return true
    end
   
    if playerDirection == NORTH
        playerPosition.y = playerPosition.y - 1
    elseif playerDirection == EAST then
        playerPosition.x = playerPosition.x + 1
    elseif playerDirection == SOUTH then
        playerPosition.y = playerPosition.y + 1
    elseif playerDirection == WEST then
        playerPosition.x = playerPosition.x - 1
    end
   
    doConvinceCreature(cid, doCreateMonster("Tiger", playerPosition))
    return true
end
 
Back
Top