Hello,
I'm requesting a script for the following:-
If a tiger is in a certain area then a lever can be pulled and the player will be teleported. This is basically the concept of the Nomads Land Quest in Rl tibia. I've been searching all around and been experimenting on my own to see if i can find anything but alas the closest I've gotten is the following script :-
this is a creature script I tie in to my lever by usee of the global storage. If globalstrage == 2021 then teleport player and what not..
The issue of course with this script is that it only works if the tiger is killed IN the room. I on the other hand want the tiger to be alive. I was also hoping I could have this all in one action script for the lever instead of a creature script because I imagine it's quite resource heavy to continuously reset. So if it's possible for there to be a check when the lever is being pulled that would be great. Any help is appreciated! Thank you.
I'm requesting a script for the following:-
If a tiger is in a certain area then a lever can be pulled and the player will be teleported. This is basically the concept of the Nomads Land Quest in Rl tibia. I've been searching all around and been experimenting on my own to see if i can find anything but alas the closest I've gotten is the following script :-
Code:
local monster = "Tiger" -- name of the monster
local storage = 2021 -- global storage value used to know that lever is available
local area = { -- frompos: upper left corner -- topos: right bottom corner
[1] = {frompos={x = 33194, y = 32854, z = 9}, topos={x = 33197, y = 32855, z = 9}}--,
-- can add more positions where this applies to our condition
-- [2] = {frompos={x=1000,y=1000,z=7}, topos={x=1001,y=1001,z=7}},
-- [3] = {frompos={x=1000,y=1000,z=7}, topos={x=1001,y=1001,z=7}}
}
function onKill(cid, target, lastHit)
if isMonster(target) and string.lower(getCreatureName(target)) == string.lower(monster) then
for i, pos in pairs(area) do
if isInRange(getThingPos(target), pos.frompos, pos.topos) then
setGlobalStorageValue(storage, 1) -- set global to 1
addEvent(setGlobalStorageValue, 10000, storage, 0) -- reset in 60 secs
end
end
end
return true
end
this is a creature script I tie in to my lever by usee of the global storage. If globalstrage == 2021 then teleport player and what not..
The issue of course with this script is that it only works if the tiger is killed IN the room. I on the other hand want the tiger to be alive. I was also hoping I could have this all in one action script for the lever instead of a creature script because I imagine it's quite resource heavy to continuously reset. So if it's possible for there to be a check when the lever is being pulled that would be great. Any help is appreciated! Thank you.