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

Switch summon monster

Etzi

New Member
Joined
May 19, 2014
Messages
28
Reaction score
1
TFS 0.3.6 8.60 Hello, when you pull switch it will summon monster on X position and remove a stone from X position switch will be reset in (2 minutes) same with the stone
 
Code:
local Sir_islam = {
Monster_Position = {x = 1867, y =2070, z = 15},
Monster_name = "demon",
Stone_Id = 9532,
Stone_Position = {x=1866, y=2070, z=15},
time_rest = 2 -- in minutes
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getTileItemById(Sir_islam.Stone_Position, Sir_islam.Stone_Id).uid > 0 then
         addEvent(doCreateItem, Sir_islam.time_rest *60* 1000, Sir_islam.Stone_Id, 1, Sir_islam.Stone_Position)
         doRemoveItem(getTileItemById(Sir_islam.Stone_Position, Sir_islam.Stone_Id).uid)
         doCreateMonster(Sir_islam.Monster_name,Sir_islam.Monster_Position,false,false)
         else
       doPlayerSendTextMessage(cid, 34, "The Stone is removed already.")
    end
    return true
end
tell me if you got any problem i will fix it
 
Back
Top