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

Tile which makes summons which player can control

BugaS

Donżuan
Joined
Mar 12, 2009
Messages
1,219
Reaction score
9
Location
NYC
Hey guys! Is it possible to make a tile on stepin it make a two summons, which player can control? Fox example attack with summons the monster? How to make it just works only once?
 
This should summon 2 rats when the player stepIn to a tile, if the player already have summons it should first remove the summons and then summon 2 new ones. can be added a playerStorage to make it impossible to summon new monsters
Was made for TFS 0.3.6 not tested!

LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
   if(isPlayerGhost(cid)) then
       return true
   end

   local summons = getCreatureSummons(cid)
   -- remove all summons if player already have summons ;)
   if(table.maxn(summons) > 0) then
       for _, pid in ipairs(summons) do
           doRemoveCreature(pid)
       end
   end
  
   if(table.maxn(summons) <= 0) then
       local monster = "Rat"   -- change this to the monster you want to summon
       local monsterAmount = 2   -- Amount of monsters to summon
      
       for monsterAmount do
           doSummonCreature(monster, getCreaturePosition(cid))
       end
      
   end
  
   return true
end
 
This should summon 2 rats when the player stepIn to a tile, if the player already have summons it should first remove the summons and then summon 2 new ones. can be added a playerStorage to make it impossible to summon new monsters
Was made for TFS 0.3.6 not tested!

LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
   if(isPlayerGhost(cid)) then
       return true
   end

   local summons = getCreatureSummons(cid)
   -- remove all summons if player already have summons ;)
   if(table.maxn(summons) > 0) then
       for _, pid in ipairs(summons) do
           doRemoveCreature(pid)
       end
   end
 
   if(table.maxn(summons) <= 0) then
       local monster = "Rat"   -- change this to the monster you want to summon
       local monsterAmount = 2   -- Amount of monsters to summon
    
       for monsterAmount do
           doSummonCreature(monster, getCreaturePosition(cid))
       end
    
   end
 
   return true
end
Sorry, there is an error:

[10:11:32.533] [Error - LuaInterface::loadFile] data/movements/scripts/summony.lua:18: '=' or 'in' expected near 'do'
[10:11:32.535] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/summony.lua)
[10:11:32.535] data/movements/scripts/summony.lua:18: '=' or 'in' expected near 'do'
 
Last edited:
Ye, i did test IT Quick on 0.3.6 and the for loop was incomplete. Im still learning, and the support/request forum section is Great for training/learning. As i told you in PM Im busy the following week but when i get back home i Will try to help you fix the scripts. Unless you already got IT working.
 
Back
Top