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

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

Status
Not open for further replies.

Xikini

I whore myself out for likes
Senator
Premium User
Joined
Nov 17, 2010
Messages
6,790
Solutions
581
Reaction score
5,354
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

Code:
How to make shorter links to posts.
https://otland.net/threads/234306/page-14#post-2330703
 
Last edited:
i completely forgot to even set the group lol
Lua:
local combat = Combat()
combat:setParameter(COMBAT_PARAM_AGGRESSIVE, true)
combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_RED)

local function resetGroup(cid)
    local player = Player(cid)
    if not player then
        return
    end
    player:setGroup(Group(1))
end

local function sendEffects(cid)
    local player = Player(cid)
    if not player then
        return
    end
    if player:getGroup():getId() == 4 then
        player:getPosition():sendMagicEffect(CONST_ME_MAGIC_RED)
        addEvent(sendEffects, 1000, cid)
    end
end

function onCastSpell(creature, variant)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    player:setGroup(Group(4))
    addEvent(resetGroup, 5000, player:getId())
    sendEffects(player:getId())
    return combat:execute(creature, variant)
end

IT WORKS! :D
thank you so much for your help :p
 
Hey do you have a good rebirth system for tfs 0.3.6 client version 8.6? The ones that i have found either give me errors that dont really make any sense to me or the script it self dont work in general.
 
Hey do you have a good rebirth system for tfs 0.3.6 client version 8.6? The ones that i have found either give me errors that dont really make any sense to me or the script it self dont work in general.
I've never made one before, because there has always been multiple multiple available ones here on the forum.
In most cases this also requires some sort of database querie, which is unfortunately one of my no-go area's.

If your having an issue with an already existing rebirth system, you can always post your issues on the support board.
I'm sure you'll find good help there with most/any of your issues.
 
I know that you said that you don't make spells, but I got a huge problem with a "sequencial spell" for 3.7... spent at least 18 hours looking for something that can make this spell work

Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLSTONE)
combat1:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat1:setParameter(COMBAT_PARAM_USECHARGES, 1)

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLSTONE)
combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat2:setParameter(COMBAT_PARAM_USECHARGES, 1)

local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_LARGEROCK)
combat3:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat3:setParameter(COMBAT_PARAM_USECHARGES, 1)


function onGetFormulaValues1(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.06) + 7) + (levelTotal)), -(((skillTotal * 0.1) + 11) + (levelTotal))
end
combat1:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues1")

function onGetFormulaValues2(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.06) + 7) + (levelTotal)), -(((skillTotal * 0.1) + 11) + (levelTotal))
end
combat2:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues2")

function onGetFormulaValues3(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.06) + 7) + (levelTotal)), -(((skillTotal * 0.1) + 11) + (levelTotal))
end
combat3:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues3")


local function onCastSpell1(creature, var)
    return combat1:execute(creature, var)
end

local function onCastSpell2(creature, var)
    return combat2:execute(creature, var)
end

local function onCastSpell3(creature, var)
    return combat3:execute(creature, var)
end


function onCastSpell(creature, var)
    local parameters = { creature = creature, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3 }

    addEvent(onCastSpell1, 100, parameters)
    addEvent(onCastSpell2, 800, parameters)
    addEvent(onCastSpell2, 1500, parameters)
end

This is the closest that I got... but it fails miserably =/
 
Hello, xikini, u can help me ?. I need a script is that at a certain time of day a stone is removed and then a teleportation is created with limit people to enter, takes you to a room after people enter the portal closes and after 5 minutes, they start to summon monsters in the area, in that area the last to remain will be teleported to safety will take a reward


Version: 0.3.7(OTX2 LORD ZEDD)

-If you enter the number of persons established = start event and close teleport
-If you do not enter the number of established people, expels all = remove teleport and create the stone.
-The teleport will be open for 10 minutes.

-Reward: item or points (Database) (Config if u want items or points).
 
Last edited:
I know that you said that you don't make spells, but I got a huge problem with a "sequencial spell" for 3.7... spent at least 18 hours looking for something that can make this spell work

Lua:
local combat1 = Combat()
combat1:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat1:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat1:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLSTONE)
combat1:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat1:setParameter(COMBAT_PARAM_USECHARGES, 1)

local combat2 = Combat()
combat2:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat2:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat2:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLSTONE)
combat2:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat2:setParameter(COMBAT_PARAM_USECHARGES, 1)

local combat3 = Combat()
combat3:setParameter(COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
combat3:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
combat3:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_LARGEROCK)
combat3:setParameter(COMBAT_PARAM_BLOCKARMOR, 1)
combat3:setParameter(COMBAT_PARAM_USECHARGES, 1)


function onGetFormulaValues1(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.06) + 7) + (levelTotal)), -(((skillTotal * 0.1) + 11) + (levelTotal))
end
combat1:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues1")

function onGetFormulaValues2(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.06) + 7) + (levelTotal)), -(((skillTotal * 0.1) + 11) + (levelTotal))
end
combat2:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues2")

function onGetFormulaValues3(player, skill, attack, factor)
    local skillTotal = skill * attack
    local levelTotal = player:getLevel() / 5
    return -(((skillTotal * 0.06) + 7) + (levelTotal)), -(((skillTotal * 0.1) + 11) + (levelTotal))
end
combat3:setCallback(CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues3")


local function onCastSpell1(creature, var)
    return combat1:execute(creature, var)
end

local function onCastSpell2(creature, var)
    return combat2:execute(creature, var)
end

local function onCastSpell3(creature, var)
    return combat3:execute(creature, var)
end


function onCastSpell(creature, var)
    local parameters = { creature = creature, var = var, combat1 = combat1, combat2 = combat2, combat3 = combat3 }

    addEvent(onCastSpell1, 100, parameters)
    addEvent(onCastSpell2, 800, parameters)
    addEvent(onCastSpell2, 1500, parameters)
end

This is the closest that I got... but it fails miserably =/
then make a support thread...
 
Hello, xikini, u can help me ?. I need a script is that at a certain time of day a stone is removed and then a teleportation is created with limit people to enter, takes you to a room after people enter the portal closes and after 5 minutes, they start to summon monsters in the area, in that area the last to remain will be teleported to safety will take a reward


Version: 0.3.7(OTX2 LORD ZEDD)

-If you enter the number of persons established = start event and close teleport
-If you do not enter the number of established people, expels all = remove teleport and create the stone.
-The teleport will be open for 10 minutes.

-Reward: item or points (Database) (Config if u want items or points).
Should only take about 30 minutes to make. (if it even takes that long)
But too annoying to script at work.
I'll make it tomorrow, when I'm off work.
Too many errands after work today.

-- initial thoughts --
movements script to get players into area, count players in area, summon monsters, and put remaining players into the reward area.
global event to spawn and remove teleporter (only visual, has no effect)
login script, to remove players who logged in area. (to prevent extra players from joining event, and also to remove stuck players)
action script, to give players their reward.


-- 2 questions.

Rewards
- I ain't scripting the points in, but I'll leave an area for you to put it in.

- Items, is it multiple choice or random item?
- Are the rewards 1 time rewards or everytime they finish the event?

Event
- is it a timed event? (spawn monsters for 15 minutes, then end?) (aka: survival)
- or is it a completion event? (spawn x monsters, when monsters are killed -> spawn next wave -> repeat until waves exhausted, then send players to reward area.)
 
Should only take about 30 minutes to make. (if it even takes that long)
But too annoying to script at work.
I'll make it tomorrow, when I'm off work.
Too many errands after work today.

-- initial thoughts --
movements script to get players into area, count players in area, summon monsters, and put remaining players into the reward area.
global event to spawn and remove teleporter (only visual, has no effect)
login script, to remove players who logged in area. (to prevent extra players from joining event, and also to remove stuck players)
action script, to give players their reward.


-- 2 questions.

Rewards
- I ain't scripting the points in, but I'll leave an area for you to put it in.

- Items, is it multiple choice or random item?
- Are the rewards 1 time rewards or everytime they finish the event?

Event
- is it a timed event? (spawn monsters for 15 minutes, then end?) (aka: survival)
- or is it a completion event? (spawn x monsters, when monsters are killed -> spawn next wave -> repeat until waves exhausted, then send players to reward area.)

-Items, is it multiple choice or random item?
R: Random

- Are the rewards 1 time rewards or everytime they finish the event?
R: Last man in area, he take reward

Spawn of monsters-> per wave of 4 or 5 minutes (3 Wave)(Until the last player is teleported to a safe area and awarded their prize, then clean the room.)

-Global event to spawn and remove teleporter (only visual, has no effect)
R: Some effects to give a little atmosphere, and the message to start / close the event, also the winner.
 
Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

For clarity's sake,
I will script actionscripts, creaturescripts, globalevents, talkactions, movements, npcs for you.
I will not script spells, weapons, raids or monster scripts.
Additionally, source editing, websites and database queries are a no go as well.

# No current requests pending.
https://otland.net/threads/234306/page-31#post-2385316
Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]
Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]


Thread closed indefinitely. (closing statement here)
Some semi-cool scripts are posted in the second comment.
I suggest going through the thread page by page, because there is many scripts not linked, that are pretty cool and/or useful in their own right.

Cheers,

Xikini


----------

Doing quick (30 min or less) scripts for [0.3.7 & (0.3.6/0.4)]
I am not here to fix your broken scripts, although I will give advice if requested.
I am here for script requests of scripts not already available on the forum.
If you require support for your scripting issues please make a thread in the support section.

Hey OtLand.

Quick introduction.

My name in a video! Because Reasons.
My name is Xikini. I live in Canada, age 23 - almost 24.
I help my friend on and off with his project Tibia Kingdoms. Kind of in a lull, as I'm mostly helping with lore at the moment, and it does get dull doing the same stuff for a couple of weeks, so I'm opening this thread to help people with some easy scripts or npc's / quests that they may need help on, or simply want someone else to do some scripts for them.

Into the main part of the thread.

I primarily script for a 0.3.7 TFS server. 0.3.6 and 0.4 are very similar, and I've never had problems creating scripts for either TFS. They all use the same functions as far as I can tell. I cannot script 1.xx, so please, don't ask for them.
I'm not an exceptional scripter, but I have learned most of the basics and starting to learn more advanced scripts.

I primarily script for movements/actions/creaturescripts/npcs.
Some recent work I've done.
Casino machine with random rewards? Done.
Making long scripts nice and short? Done and Done.
Making scripts more complicated then people require? Done.
Getting irritated and thoroughly explaining a base script? Done.
Providing alternative ways to create a script? Done.
Stopping the usage of parcels in Rookgaard? Done.
Healing tiles for players? Done.
Simple bridge levers? Done.
Poi tombstone entrance? Done.

If any of this seems interesting and you would like some scripts scripted by me, send a PM my way.
If I'm unable to script your request I will definitely tell you.
If I find an interesting script I'll post it below for others to use and benefit from. I will credit your name for the original request as well. Of course if you really want me to not post a finished script or request you've made I will not share it with the community.

The scripting service provided here is free, so don't hound me to complete scripts you've requested, and I've agreed to make. If I agree to make it, I'll try to give you a timeline on completion. And please, please, if I say I can't script something, don't beg me to create it, or attempt to bribe me to create it. If I can't script it, I can't script it. I'm only a mediocre scripter. Please take that to heart.

To sum things up, I enjoy scripting and helping others and want to contribute to the community a little.
So send me a PM, or post below, and we'll see what we can come up with.
7Lo6SYq.png

On that note,

Cheers,

Xikini


(Quick side note: No script is too small for me to make or help with. With that in mind, I currently do not work with databases, php, source edits or websites.
Additionally, I do not make spells, raids, monsters or weapon scripts. Thanks!)

I need a script that recovers stamina when the player sleeps.

Because it is not recovering stamina offline.

Could someone help me with this?

I'm using Tfs 0.4_svn
 
Just finished it.
But okay.
I need a script that recovers stamina when the player sleeps.

Because it is not recovering stamina offline.

Could someone help me with this?

I'm using Tfs 0.4_svn
I could probably do a login command..
But I'm not sure how to check if the player is/was sleeping previously.
 
Xikini, i need a little help with one of your scripts, i'm using your Turk The Smelly task Npc, and i wanted a quest where people must kill for example all the Demons on the task, once they killed all the monsters they were able to go inside. I tried making it like i would a normal Quest, got the NPC storage for that quest and added to a tile. However once they kill just 1 monster, they are able to step on the tile. Any thoughts on that?
 
Xikini, i need a little help with one of your scripts, i'm using your Turk The Smelly task Npc, and i wanted a quest where people must kill for example all the Demons on the task, once they killed all the monsters they were able to go inside. I tried making it like i would a normal Quest, got the NPC storage for that quest and added to a tile. However once they kill just 1 monster, they are able to step on the tile. Any thoughts on that?
Lua:
if getPlayerStorageValue(cid, 45045) == 2 then
    -- you have finished the task
else
    -- you have not finished the task
end
You can put this into any script that requires the demon task to be completed.

Note: If you changed the demon's storage number, please update that number in the above script.

For future,
-1 and 0 means the task has not been started.
1 means the task is in progress.
2 means the task is completed.

-- Killing creatures task, in case you have trouble finding it.

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]
 
hey there i'm using tfs 0.4 ..
and facing some problems,

first of all it's the zombie event, it's working okay but there is a stones closing the zombie area and when I say /zombie start

the stones are removed automatic duo to this script :

Code:
function getZombiesEventPlayers()
    local players = {}
    for _, zid in pairs(getPlayersOnline()) do
        if getPlayerStorageValue(zid, 1288) == 1 then
            table.insert(players, zid)
        end
    end
    return players
end
local players = getZombiesEventPlayers()
function onSay(cid, words, param, channel)
local t = split(param, ',')
local stones = {
{x = 1054, y = 1183, z = 7},
{x = 1055, y = 1183, z = 7},
{x = 1056, y = 1183, z = 7},
{x = 1057, y = 1183, z = 7}
}
local pumkins = {
{x = 1053, y = 1172, z = 7},
{x = 1062, y = 1174, z = 7},
{x = 1057, y = 1167, z = 7},
{x = 1044, y = 1173, z = 7}
}
---------------------------------------------------------------------------------------------------------------------------
if (t[1] == 'start') then
local storage = getGlobalStorageValue(1285)
if  storage == 1 then
for _, bid in pairs(getPlayersOnline()) do
if getCreatureStorage(bid, 1288) == 1 and getPlayerAccess(bid) < 3 then
local newpos = {x = 1055, y = 1182, z = 7}
doTeleportThing(bid, newpos)
end
end
for i = 1, 4 do
doSendMagicEffect(stones[i], 35)
doRemoveItem(getTileItemById({x = 1054, y = 1183, z = 7}, 1285).uid)
doRemoveItem(getTileItemById({x = 1055, y = 1183, z = 7}, 1285).uid)
doRemoveItem(getTileItemById({x = 1056, y = 1183, z = 7}, 1285).uid)
doRemoveItem(getTileItemById({x = 1057, y = 1183, z = 7}, 1285).uid)
doSendAnimatedText(stones[i], "RUN", 240)
end
doRemoveItem(getTileItemById({x = 991, y = 1000, z = 7}, 1387).uid)
setGlobalStorageValue(1285, 2)
doBroadcastMessage("".. getCreatureName(cid) .." has started zombie event and removed teleport in temple", MESSAGE_EVENT_ADVANCE)
for f = 1, 6 do
    doSummonCreature("Psycho Pumpkin", pumkins[f])
end
else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Open zombie teleport first with /zombie waiting.")
end
---------------------------------------------------------------------------------------------------------------------
elseif (t[1] == 'end') then
local storage = getGlobalStorageValue(1285)
if  storage ~= 0 then
function CleanPlayers()
for x = 1052, 1059 do
for y = 1183, 1187 do
local newpos = {x = 994, y = 993, z = 7}
local a = getTopCreature({x=x, y=y, z=7}).uid
if a ~= 0 and isPlayer(a) then
doTeleportThing(a, newpos)
doSendMagicEffect(newpos, CONST_ME_POFF)
end
end
end
end
for _, aid in pairs(getPlayersOnline()) do
if getCreatureStorage(aid, 1288) == 1 and getPlayerAccess(aid) < 3 then
doCreatureSetStorage(aid, 1288, 0)
end
end
CleanPlayers()
doRemoveItem(getTileItemById({x = 991, y = 1000, z = 7}, 1387).uid)
setGlobalStorageValue(1285, 0)
function CleanArena()
for x = 1042, 1070 do
for y = 1165, 1186 do
local newpos = {x = 994, y = 993, z = 7}
local a = getTopCreature({x=x, y=y, z=7}).uid
if a ~= 0 and isMonster(a) then
doRemoveCreature(a)
elseif a ~= 0 and isPlayer(a) then
doTeleportThing(a, newpos)
doSendMagicEffect(newpos, CONST_ME_POFF)
end
a = getThingfromPos({x=x, y=y, z=7, stackpos=254}).uid
if a ~= 0 then
doRemoveItem(a)
end
end
end
return true
end
CleanArena()
else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Zombie event is not open atm.")
end
--------------------------------------------------------------------------------------------------------------------------------------
elseif (t[1] == 'waiting') then
function getZombiesEventPlayers()
local players = {}
for _, zid in pairs(getPlayersOnline()) do
if getCreatureStorage(zid, 1288) == 1 and getPlayerAccess(zid) < 3 then
table.insert(players, zid)
end
end
return players
end
local storage = getGlobalStorageValue(1285)
local tp =     doCreateTeleport(1387, {x = 1055, y = 1185, z = 7}, {x = 991, y = 1000, z = 7})
if  storage ~= 1 then
    setGlobalStorageValue(1285, 1)
    doItemSetAttribute(tp, "aid", 1285)
    doBroadcastMessage("".. getCreatureName(cid) .." has started zombie event to enter go temple teleport on south", MESSAGE_EVENT_ADVANCE)
else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Zombie is already waiting for players.")
end
elseif (t[1] == 'check') then
    local players = getZombiesEventPlayers()
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[".. #players .."] players with zombie storage")
elseif (t[1] == 'kick') then
    local kid = getPlayerByNameWildcard(t[2])
    if(not kid) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have to enter player name after kick.")
    else
        if getCreatureStorage(kid, 1288) == 1 then
               doBroadcastMessage("" .. getCreatureName(cid) .. " has kicked [" .. getCreatureName(kid) .. "] from zombie event!", MESSAGE_STATUS_CONSOLE_RED)
            doCreatureSetStorage(kid, 1288, 0)
            doTeleportThing(kid, {x = 994, y = 993, z = 7})
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[".. getCreatureName(kid) .."] not in zombie event.")
        end
    end
end
return true
end


I want to edit it as i say /zombie end , the stones are back automatic and I dont need to go and put stones again after the event ends ..
 
Lua:
if getPlayerStorageValue(cid, 45045) == 2 then
    -- you have finished the task
else
    -- you have not finished the task
end
You can put this into any script that requires the demon task to be completed.

Note: If you changed the demon's storage number, please update that number in the above script.

For future,
-1 and 0 means the task has not been started.
1 means the task is in progress.
2 means the task is completed.

-- Killing creatures task, in case you have trouble finding it.

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]
You finished script?. I check every day to see if I have hope xD.
 
hey there i'm using tfs 0.4 ..
and facing some problems,

first of all it's the zombie event, it's working okay but there is a stones closing the zombie area and when I say /zombie start

the stones are removed automatic duo to this script :

Code:
function getZombiesEventPlayers()
    local players = {}
    for _, zid in pairs(getPlayersOnline()) do
        if getPlayerStorageValue(zid, 1288) == 1 then
            table.insert(players, zid)
        end
    end
    return players
end
local players = getZombiesEventPlayers()
function onSay(cid, words, param, channel)
local t = split(param, ',')
local stones = {
{x = 1054, y = 1183, z = 7},
{x = 1055, y = 1183, z = 7},
{x = 1056, y = 1183, z = 7},
{x = 1057, y = 1183, z = 7}
}
local pumkins = {
{x = 1053, y = 1172, z = 7},
{x = 1062, y = 1174, z = 7},
{x = 1057, y = 1167, z = 7},
{x = 1044, y = 1173, z = 7}
}
---------------------------------------------------------------------------------------------------------------------------
if (t[1] == 'start') then
local storage = getGlobalStorageValue(1285)
if  storage == 1 then
for _, bid in pairs(getPlayersOnline()) do
if getCreatureStorage(bid, 1288) == 1 and getPlayerAccess(bid) < 3 then
local newpos = {x = 1055, y = 1182, z = 7}
doTeleportThing(bid, newpos)
end
end
for i = 1, 4 do
doSendMagicEffect(stones[i], 35)
doRemoveItem(getTileItemById({x = 1054, y = 1183, z = 7}, 1285).uid)
doRemoveItem(getTileItemById({x = 1055, y = 1183, z = 7}, 1285).uid)
doRemoveItem(getTileItemById({x = 1056, y = 1183, z = 7}, 1285).uid)
doRemoveItem(getTileItemById({x = 1057, y = 1183, z = 7}, 1285).uid)
doSendAnimatedText(stones[i], "RUN", 240)
end
doRemoveItem(getTileItemById({x = 991, y = 1000, z = 7}, 1387).uid)
setGlobalStorageValue(1285, 2)
doBroadcastMessage("".. getCreatureName(cid) .." has started zombie event and removed teleport in temple", MESSAGE_EVENT_ADVANCE)
for f = 1, 6 do
    doSummonCreature("Psycho Pumpkin", pumkins[f])
end
else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Open zombie teleport first with /zombie waiting.")
end
---------------------------------------------------------------------------------------------------------------------
elseif (t[1] == 'end') then
local storage = getGlobalStorageValue(1285)
if  storage ~= 0 then
function CleanPlayers()
for x = 1052, 1059 do
for y = 1183, 1187 do
local newpos = {x = 994, y = 993, z = 7}
local a = getTopCreature({x=x, y=y, z=7}).uid
if a ~= 0 and isPlayer(a) then
doTeleportThing(a, newpos)
doSendMagicEffect(newpos, CONST_ME_POFF)
end
end
end
end
for _, aid in pairs(getPlayersOnline()) do
if getCreatureStorage(aid, 1288) == 1 and getPlayerAccess(aid) < 3 then
doCreatureSetStorage(aid, 1288, 0)
end
end
CleanPlayers()
doRemoveItem(getTileItemById({x = 991, y = 1000, z = 7}, 1387).uid)
setGlobalStorageValue(1285, 0)
function CleanArena()
for x = 1042, 1070 do
for y = 1165, 1186 do
local newpos = {x = 994, y = 993, z = 7}
local a = getTopCreature({x=x, y=y, z=7}).uid
if a ~= 0 and isMonster(a) then
doRemoveCreature(a)
elseif a ~= 0 and isPlayer(a) then
doTeleportThing(a, newpos)
doSendMagicEffect(newpos, CONST_ME_POFF)
end
a = getThingfromPos({x=x, y=y, z=7, stackpos=254}).uid
if a ~= 0 then
doRemoveItem(a)
end
end
end
return true
end
CleanArena()
else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Zombie event is not open atm.")
end
--------------------------------------------------------------------------------------------------------------------------------------
elseif (t[1] == 'waiting') then
function getZombiesEventPlayers()
local players = {}
for _, zid in pairs(getPlayersOnline()) do
if getCreatureStorage(zid, 1288) == 1 and getPlayerAccess(zid) < 3 then
table.insert(players, zid)
end
end
return players
end
local storage = getGlobalStorageValue(1285)
local tp =     doCreateTeleport(1387, {x = 1055, y = 1185, z = 7}, {x = 991, y = 1000, z = 7})
if  storage ~= 1 then
    setGlobalStorageValue(1285, 1)
    doItemSetAttribute(tp, "aid", 1285)
    doBroadcastMessage("".. getCreatureName(cid) .." has started zombie event to enter go temple teleport on south", MESSAGE_EVENT_ADVANCE)
else
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Zombie is already waiting for players.")
end
elseif (t[1] == 'check') then
    local players = getZombiesEventPlayers()
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[".. #players .."] players with zombie storage")
elseif (t[1] == 'kick') then
    local kid = getPlayerByNameWildcard(t[2])
    if(not kid) then
        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You have to enter player name after kick.")
    else
        if getCreatureStorage(kid, 1288) == 1 then
               doBroadcastMessage("" .. getCreatureName(cid) .. " has kicked [" .. getCreatureName(kid) .. "] from zombie event!", MESSAGE_STATUS_CONSOLE_RED)
            doCreatureSetStorage(kid, 1288, 0)
            doTeleportThing(kid, {x = 994, y = 993, z = 7})
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[".. getCreatureName(kid) .."] not in zombie event.")
        end
    end
end
return true
end


I want to edit it as i say /zombie end , the stones are back automatic and I dont need to go and put stones again after the event ends ..
Lua - Zombie Event Stones & other console error 0.4
You finished script?. I check every day to see if I have hope xD.
I thought you didn't want the script earlier?
Ok, ty man. I'am here waiting.
I can remake it again if you want.
It's really no trouble.
 
Lua:
if getPlayerStorageValue(cid, 45045) == 2 then
    -- you have finished the task
else
    -- you have not finished the task
end
You can put this into any script that requires the demon task to be completed.

Note: If you changed the demon's storage number, please update that number in the above script.

For future,
-1 and 0 means the task has not been started.
1 means the task is in progress.
2 means the task is completed.

-- Killing creatures task, in case you have trouble finding it.

Xikini's Free Scripting Service. [0.3.7 & (0.3.6/0.4)]

I don't have any scripts that require the Task, i just tried using the Actionid as i would use for quests.

A player finishes a quest, get's the storage from the chest, now his character has that storage and he can step in the Tile. I didn't make a script for that, but i'm pretty sure i can figure something out, thanks anyway Xikini <3 Always helpfull.
 
Status
Not open for further replies.

Similar threads

Back
Top