Event based on players trying to get through a small isle possible 2-3sqm, the players try to run though without getting hit by the fire. If they get hit, back to restart.
(creates dead bodys, and cleans.)
Players dont acually die, just teleported back.
Talkaction:
GlobalEvent: Assuming 2000 is 2 seconds.
if you want them to spawn faster add more doCreateItem(math.random(positions), evil_fire)
MoveEvents:
- - - Updated - - -
Imagine a system thats not free.....
(creates dead bodys, and cleans.)
Players dont acually die, just teleported back.
Talkaction:
Code:
<talkaction words="!pits of hell;/pits of hell;/close" event="script" value="pits of hell.lua"/>
Lua:
local pitPosition = {x = 1000, y = 1000, z = 7}
function onSay(cid, words, param, channel)
if (param == "") or (param == nil) then
doPlayerSendCancel(cid, "Command param required.")
return false
end
if (param == "!pit of hell") then
doTeleportThing(cid, pitPosition)
doPlayerPopupFYI(cid, "Welcome to the pits of hell!")
end
if (not getPlayerAccess(cid) >= access_to_use) then
doPlayerSendCancel(cid, "You cannot use this command.")
return false
end
if (param == "/pit of hell") then
setGlobalStorageValue(pit_of_hell, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have started pits of hell.")
doBroacastMessage("The firey pits of hell are open! Get there fast!", 1)
end
if (param == "/close") then
if getGlobalStorageValue(pit_of_hell) == 1 then
setGlobalStorageValue(pit_of_hell, 0)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have close pits of hell.")
doBroacastMessage("The firey pits of hell are closed! May your souls rest in peace.", 1)
else
doPlayerSendCancel(cid, "The pits of hell are not open.")
return false
end
end
return true
end
GlobalEvent: Assuming 2000 is 2 seconds.
if you want them to spawn faster add more doCreateItem(math.random(positions), evil_fire)
Code:
<globalevent name="pit of hell" interval="2000" event="script" value="pits of hell.lua"/>
Lua:
local positions = {
[1] = {x = 1000, y = 1000, z = 7},
[2] = {x = 1000, y = 1000, z = 7},
[3] = {x = 1000, y = 1000, z = 7},
[4] = {x = 1000, y = 1000, z = 7},
[5] = {x = 1000, y = 1000, z = 7},
[6] = {x = 1000, y = 1000, z = 7},
[7] = {x = 1000, y = 1000, z = 7},
[8] = {x = 1000, y = 1000, z = 7},
[9] = {x = 1000, y = 1000, z = 7},
[10] = {x = 1000, y = 1000, z = 7}
}
local evil_fire = 1111 --Item to kill them if they walk in it--
function onThink(interval, lastExecution, thinkInterval)
if (not getGlobalStorageValue(pit_of_hell) == 1 then
return false
end
if getGlobalStorageValue(pit_of_hell) == 1 then
doCreateItem(math.random(positions), evil_fire)
doRemoveItem(positions, evil_fire)
if isCorpse(positions) then
doRemoveItem(item.itemid)
end
end
end
end
MoveEvents:
Code:
<movevent type="StepIn" itemid="evil_fire_id" event="script" value="pits of hell.lua"/>
<movevent type="StepOut" itemid="evil_fire_id" event="script" value="pits of hell.lua"/>
Lua:
local eventpos = {
[1] = {x = 1000, y = 1000, z = 7},
[2] = {x = 1000, y = 1000, z = 7}, -- This is so you can make players teleport to more then one place (help player stack lag) --
[3] = {x = 1000, y = 1000, z = 7},
[4] = {x = 1000, y = 1000, z = 7}
}
local evil_fire = 1111
function onStepIn(cid, item, position, fromPosition)
if getGlobalStorageValue(pit_of_hell) == 1 then
if item.itemid == evil_fire then
doCreateItem(getPlayerPosition(cid), 2317)
doTeleportThing(cid, math.random(eventpos))
end
end
end
function onStepOut(cid, item, position, fromPosition)
if getGlobalStorageValue(pit_of_hell) == 1 then
if item.itemid == evil_fire then
doCreateItem(getPlayerPosition(cid), 2317)
doTeleportThing(cid, math.random(eventpos))
end
end
end
- - - Updated - - -
Imagine a system thats not free.....