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

Boos Room script?

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
47
Hey, i searching boss room script, i have room 3x3 on central sqm is spawn boos, but i need script to kick from room and create blockade for doors if boss be killed.
Boss time to respawn is 60min
 
Why dont you make just and entrance without exit? So in that way you dont need blockade for doors. About that moment when boss is killed why just dont you use corpses as teleport? I know its sounds like in ice age :D
 
Why dont you make just and entrance without exit? So in that way you dont need blockade for doors. About that moment when boss is killed why just dont you use corpses as teleport? I know its sounds like in ice age :D

I have exit tp but i want blockade doors if boss is killed.
 
Hey, i searching boss room script, i have room 3x3 on central sqm is spawn boos, but i need script to kick from room and create blockade for doors if boss be killed.
Boss time to respawn is 60min

expect errors, post them here if any :p

LUA:
local boss_name = "BOSS_NAME_HERE"
local room_pos = {x = 1000, y = 1000, z = 7} -- POSITION WHERE BOSS SPAWNS
local new_location {x = 1200, y = 1200, z = 7} -- LOCATION FOR KICKING PLAYERS
local blockade_pos = {x = 1010, y = 1010, z = 7} -- CREATE WALL IN THIS POSITION
local wall_id = 2165 -- WALL ID

function onKill(creature, target)
    local monster = target:getMonster()
    if not monster then
        return true
    end
   
    local monsterName = monster:getName():lower()
    if monsterName == boss_name:lower() then
        local spectators = getSpectators(room_pos, false, false, 0, 1, 0, 1)
       
        for i = 1, #spectators do
            if spectators[i]:isPlayer() then
                spectators[i]:teleportTo(new_location)
            end
        end
       
        Game.createItem(wall_id, 1, blockade_pos)
    end
   
    return true
end
 
expect errors, post them here if any :p

LUA:
local boss_name = "BOSS_NAME_HERE"
local room_pos = {x = 1000, y = 1000, z = 7} -- POSITION WHERE BOSS SPAWNS
local new_location {x = 1200, y = 1200, z = 7} -- LOCATION FOR KICKING PLAYERS
local blockade_pos = {x = 1010, y = 1010, z = 7} -- CREATE WALL IN THIS POSITION
local wall_id = 2165 -- WALL ID

function onKill(creature, target)
    local monster = target:getMonster()
    if not monster then
        return true
    end
 
    local monsterName = monster:getName():lower()
    if monsterName == boss_name:lower() then
        local spectators = getSpectators(room_pos, false, false, 0, 1, 0, 1)
     
        for i = 1, #spectators do
            if spectators[i]:isPlayer() then
                spectators[i]:teleportTo(new_location)
            end
        end
     
        Game.createItem(wall_id, 1, blockade_pos)
    end
 
    return true
end

This script not work, if i killed boss he dont dieying he's still alive verytime and server giving me reward every 1 s.
(he's still alive but he dont has name)
//edit
Okey, i changed event type from kill to death and now he dieying but script dont kick me from room and dont create wall.
 
This script not work, if i killed boss he dont dieying he's still alive verytime and server giving me reward every 1 s.
(he's still alive but he dont has name)
//edit
Okey, i changed event type from kill to death and now he dieying but script dont kick me from room and dont create wall.

can you show error message from the console please (using onKill function)

and tell me your tfs version
 
I dont have errors in console :D TFS 0.4

data\creaturescripts\scripts\nScript.lua - create this File and add the following

LUA:
local boss_name = "BOSS_NAME_HERE"
local room_pos = {x = 1000, y = 1000, z = 7} -- POSITION WHERE BOSS SPAWNS
local new_location {x = 1200, y = 1200, z = 7} -- LOCATION FOR KICKING PLAYERS
local blockade_pos = {x = 1010, y = 1010, z = 7} -- CREATE WALL IN THIS POSITION
local wall_id = 2165 -- WALL ID

function onKill(cid, target)
  local monster = getCreatureName(target):lower()
    if monster == boss_name:lower() then
   local spectators = getSpectators(room_pos, 1, 1)
        for i = 1, #spectators do
            if isPlayer(spectators[i]) then
             doTeleportThing(spectators[i], new_location)
            end
        end

    doCreateItem(wall_id, 1, blockade_pos)
    end
 
    return true
end


data\creaturescripts\creaturescripts.xml - open this File and add this line

XML:
<event type="kill" name="nKill" event="script" value="nScript.lua"/>

data\monster\YOUR BOSS FILE.xml- open your boss File

add the following after </flags>:

XML:
<script>
        <event name="nKill" />
</script>
 
Last edited:
data\creaturescripts\scripts\nScript.lua - create this File and add the following

LUA:
local boss_name = "BOSS_NAME_HERE"
local room_pos = {x = 1000, y = 1000, z = 7} -- POSITION WHERE BOSS SPAWNS
local new_location {x = 1200, y = 1200, z = 7} -- LOCATION FOR KICKING PLAYERS
local blockade_pos = {x = 1010, y = 1010, z = 7} -- CREATE WALL IN THIS POSITION
local wall_id = 2165 -- WALL ID

function onKill(cid, target)
  local monster = getCreatureName(target):lower()
    if monster == boss_name:lower() then
   local spectators = getSpectators(room_pos, 1, 1)
        for i = 1, #spectators do
            if isPlayer(spectators[i]) then
             doTeleportThing(spectators[i], new_location)
            end
        end

    doCreateItem(wall_id, 1, blockade_pos)
    end
 
    return true
end


data\creaturescripts\creaturescripts.xml - open this File and add this line

XML:
<event type="kill" name="nKill" event="script" value="nScript.lua"/>

data\monster\YOUR BOSS FILE.xml- open your boss File

add the following after </flags>:

XML:
<script>
        <event name="nKill" />
</script>
Not work

- no errors
- no kick
- no blockade
 
Back
Top