Competitibia
Pain & Glory WHole
- Joined
- Apr 1, 2021
- Messages
- 545
- Solutions
- 3
- Reaction score
- 210
Code does not give 10 minutes it never kicks
Lua:
local monster = "The Horned Fox"
function onStepIn(cid, item, frompos, item2, topos)
local room = { -- room with Hide
fromX = 33300,
fromY = 32277,
fromZ = 13,
toX = 33316,
toY = 32293,
toZ = 13}
local config = {
bosspos = {
{x=33308,y=32280,z=13}, -- position where boss first spawns
},
boss = "The Horned Fox", -- name of the boss
from = {{x = 33300, y = 32277, z = 13}},
to = {{x = 33316, y = 32293, z = 13}},
}
local player_pos = {x=33308, y=32288, z=13}
local cansel_pos = {x=33308, y=32285, z=12}
if item.uid == 34254 then
killedhide = getPlayerStorageValue(cid,34254)
if killedhide == -1 then
local monster_room = false
local monsters = {}
local i = 1
for x = room.fromX, room.toX do
for y = room.fromY, room.toY do
for z = room.fromZ, room.toZ do
local pos = {x=x, y=y, z=z,stackpos = 253}
local thing = getThingfromPos(pos)
if isPlayer(thing.uid) then
doPlayerSendTextMessage(cid,19,"There is already some one in the quest room.")
return true
elseif isMonster(thing.uid) then
monsters[i] = getThingfromPos({x=x,y=y,z=areaposrightdown.z,stackpos=253})
i = i+1
monster_room = true
end
end
end
end
if monster_room then
for r = 1, #monsters do
doRemoveCreature(monsters[r].uid)
end
end
doTeleportThing(cid, player_pos)
doSummonCreature(config.boss, config.bosspos[1])
doPlayerSetStorageValue (cid, 34254, 1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You have ten minutes to kill and loot this boss, else you will lose that chance and will be kicked out.')
else
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE,'You did not complete the task Quest or you have already fought the boss!')
doTeleportThing(cid, cansel_pos)
end
end
return true
end
Last edited: