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

Script for Lever 8.54

Lucyaga

New Member
Joined
Mar 17, 2011
Messages
18
Reaction score
2
Location
Puerto Rico
Greetings,

Its been 3 years since last time I did scripting so I'm very rusty. I'm in need of a script for a lever that when I pull the lever 4 monsters will be summon on the positions I assign.

It will be used for a dungeon where there will be a lot of levers to open the door and if you pull wrong ones, monsters will be summoned.

It must be a pretty simple script. So if anyone can help it will be much appreciated.
 
Code:
local positions = {
   {x = 100, y = 100, z = 7},
   {x = 101, y = 100, z = 7},
   {x = 102, y = 100, z = 7},
   {x = 103, y = 100, z = 7}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for _, pos in pairs(positions) do
         if not isCreature(getTopCreature(pos).uid) then
             doCreateMonster("Demon", pos, false)
         end
     end
     doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "This is the wrong one.")
     doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
     return true
end
 
Back
Top