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

[help] killing all monsters before enter the teleport

Evix

New Member
Joined
Nov 27, 2008
Messages
16
Reaction score
0
Can someone help me with a script of that?
What i want is the players cant enter in the teleport until they clean the room, i used the search function and didnt found anything about this :S
 
Here's a quick sample.

movement script
Code:
local centerRoomPos = { x = 321, y = 654, z = 7 }
local foundCreature = FALSE
function onStepIn(cid, item, position, fromPosition)
    if(item.uid = 12345) then
        local creaturesOnScreen = getSpectators(centerRoomPos, 9, 9, FALSE)
        for i = 0, creaturesOnScreen do
            if(isCreature(creaturesOnScreen[i]) == TRUE) then
                foundCreature = TRUE
            end
        next
        if(foundCreature == TRUE) then
            doTeleportThing(cid, fromPosition)
        end
    end
end
Then in movements.xml add
Code:
<movevent event="StepIn" itemid="1387" script="xxxx.lua"/>

I don't know if I got all that right, but I'm sure marcinek can correct me, :p. Just set your teleports unique ID in the map editor, and change it here (if(item.uid = 12345) then). Then get the center most position of the room and set it here (local centerRoomPos = { x = 321, y = 654, z = 7 }).

Jo3
 
Back
Top