• 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,811
Solutions
582
Reaction score
5,370
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:
@Xikini thanks it works, i tried slafesko script but it didn't work, maybe i did it wrong, i went to weapons/scripts.lua added this and named it sword, then went to weapons.xml and added it there, but idk why it didn't work :/


Edit @Xikini Request script
Can you make a script that when you move on a tile it takes "x" item from the player, and give them monsters outfit ?
 
Last edited:
@Xikini thanks it works, i tried slafesko script but it didn't work, maybe i did it wrong, i went to weapons/scripts.lua added this and named it sword, then went to weapons.xml and added it there, but idk why it didn't work :/


Edit @Xikini Request script
Can you make a script that when you move on a tile it takes "x" item from the player, and give them monsters outfit ?
I can turn them into a monster outfit, but I can't give them an outfit, unless you edit your outfits.xml to include the monster outfit.
Code:
-- <movevent type="StepIn" actionid="45577" event="script" value="test39.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if doPlayerRemoveItem(cid, 2148, 50) == true then
     local tmp = getCreatureOutfit(cid)
     tmp.lookType = 15
     doCreatureChangeOutfit(cid, tmp)
     doCreatureSay(cid, "Outfit Changed for 50 gold coins.", TALKTYPE_ORANGE_1, nil, nil, getThingPos(cid))
   end

   return true
end
I wonder if anyone will notice my troll attempt.
 
Last edited:
Code:
local reward_items = {
     [1] = {item = 2159},
}

local config = {
     sacrifice_item = 5880, -- 5880 = iron ore (Note: Item must be 'stackable')
     multi_sacrifice = 1, -- 1 = can put stacks of 100 sacrifice_item | 0 = only 1 item at a time.
     loop_1_delay = 3000, -- 1000 = 1 second
     effect = CONST_ME_HITBYFIRE,
     global_storage = 45001 -- Only required if using 'multi_sacrifice'
}

BASINEVENTS = {}

function getBasinEventIdByPos(position)
    for i, info in pairs(BASINEVENTS) do
        if type(info[1]) == "table" then
            if info[1].x == position.x and info[1].y == position.y and info[1].z == position.z then
                return i
            end
        end
    end
end

function loop_1(position, n)
     if getTileItemById(position, config.sacrifice_item).type > 0 then
         doRemoveItem(getTileItemById(position, config.sacrifice_item).uid, 1)
         doSendMagicEffect(position, config.effect)
         local rand = reward_items[math.random(#reward_items)]
         doCreateItem(rand.item, 1, position)
         if config.multi_sacrifice == 1 then
             n = 1
         else
             n = 0
         end
     end

     if(n > 0) then
         addEvent(loop_1, config.loop_1_delay, position, n - 1)
     else
        local basinId = getBasinEventIdByPos(position)
        if basinId then
            BASINEVENTS[basinId][2] = false
        end
     end
end

function onAddItem(moveitem, tileitem, pos, cid)
     if moveitem.itemid == config.sacrifice_item then
        local basinId = getBasinEventIdByPos(pos)
        if not basinId then
            table.insert(BASINEVENTS, {pos, true})
        elseif BASINEVENTS[basinId] then
            if BASINEVENTS[basinId][2] then
                return true
            else
                BASINEVENTS[basinId][2] = true
            end
        end

        addEvent(loop_1, 0, pos, 1)
     end
     return true
end


Can't test it but it should work for multiple spots and fix the addEvent issue :p
nice
 
All untested.
Install it the same way.
Please let me know if it works or not.
Thanks

The script teleports all players, but kill the rat do not start the waves. :(

Instalation.

Action:
<action actionid="2170" event="script" value="Arena_Lever.lua"/>

---------------------------------- Start Config -------------------------------

local config = {
failed_position = {x = 1027, y = 913, z = 5}, -- Player took too long position
lever_reset_time = 15, -- in minutes (how long until another player can kick them out)
global_storage = 8000, -- any free storage
top_left_corner = {x = 979, y = 901, z = 7}, -- top left corner of arena
bottom_right_corner = {x = 991, y = 905, z = 7}, -- bottom right corner of arena
joke_monster = "rat" -- They will kill this monster to start the waves
}

local players = {
[1] = { player_start_pos = {x = 993, y = 903, z = 7}, player_arena_pos = {x = 979, y = 902, z = 7} },
[2] = { player_start_pos = {x = 993, y = 905, z = 7}, player_arena_pos = {x = 979, y = 904, z = 7} },
[3] = { player_start_pos = {x = 994, y = 903, z = 7}, player_arena_pos = {x = 991, y = 902, z = 7} },
[4] = { player_start_pos = {x = 994, y = 905, z = 7}, player_arena_pos = {x = 991, y = 904, z = 7} }
}
----------------------------------- End Config --------------------------------

local function reset(p)
doTransformItem(getTileItemById(p, 1946).uid, 1945)
end

local function teleport()
for i = 1, #players do
pid = getTopCreature(players.player_start_pos).uid
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "---------------------------------------")
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Kill the creature to start Wave 1.")
doTeleportThing(pid, players.player_arena_pos)
end
doCreateMonster(config.joke_monster, players[1].player_arena_pos)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

-- check if lever is currently used
if item.itemid == 1946 then
return doPlayerSendTextMessage(cid, 22, "Wait for switch to reset. It resets automatically every ".. config.lever_reset_time .." minutes.")
end

-- check if players are standing on tiles
local count = 0
for i = 1, #players do
pid = getTopCreature(players.player_start_pos).uid
if isPlayer(pid) == true then
count = count + 1
end
end
if count < #players then
return doPlayerSendTextMessage(cid, 22, "All players must be standing on their respective tiles to enter the arena.")
end

-- check for players/monsters in arena, and kick them out/remove them
for t = config.top_left_corner.x, config.bottom_right_corner.x do
for f = config.top_left_corner.y, config.bottom_right_corner.y do
pos = {x = t, y = f, z = 7}
pid = getTopCreature(pos).uid
if isPlayer(pid) then
doTeleportThing(pid, config.failed_position)
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Another group of players started the arena. You have been removed. Better luck next time!")
end
if isMonster(pid) then
doRemoveCreature(pid)
end
end
end

-- tell players what to do
for i = 1, #players do
pid = getTopCreature(players.player_start_pos).uid
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Lever resets automatically every ".. config.lever_reset_time .." minutes.")
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Once the lever resets another group of players can start the arena.")
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "If your group is still inside when another group starts, you will be removed from the arena and unable to continue.")
end

-- reset global storage
setGlobalStorageValue(global_storage, 0)

-- teleport player to arena, send start message, create start/joke monster
addEvent(teleport, 5000)

-- transform lever, and add reset
doTransformItem(item.uid, item.itemid + 1)
addEvent(reset, ((config.lever_reset_time * 60 * 1000) + 5000), toPosition)

return true
end

Creature:

<event type="kill" name="Arena_Death" event="script" value="Arena_Death.lua"/>

local config = {
reward_position = {x = 994, y = 904, z = 7}, -- Teleport location when Arena is Cleared.
global_storage = 8000, -- any free storage
top_left_corner = {x = 979, y = 901, z = 7}, -- top left corner of arena
bottom_right_corner = {x = 991, y = 905, z = 7} -- bottom right corner of arena
}

local monsters = { -- All monsters in arena (including joke monster)
[1] = "rat",
[2] = "cave rat",
[3] = "spider",
[4] = "snake",
[1] = "bug"
}

local monster_config_wave_one = { -- wave 1
[1] = {position = {x = 985, y = 903, z = 7}, name = "cave rat"},
[2] = {position = {x = 986, y = 903, z = 7}, name = "spider"},
[3] = {position = {x = 987, y = 903, z = 7}, name = "snake"},
[4] = {position = {x = 988, y = 903, z = 7}, name = "bug"}
}

local monster_config_wave_two = { -- wave 2
[1] = {position = {x = 985, y = 903, z = 7}, name = "cave rat"},
[2] = {position = {x = 986, y = 903, z = 7}, name = "spider"},
[3] = {position = {x = 987, y = 903, z = 7}, name = "snake"},
[4] = {position = {x = 988, y = 903, z = 7}, name = "bug"}
}

local monster_config_wave_three = { -- wave 3
[1] = {position = {x = 985, y = 903, z = 7}, name = "cave rat"},
[2] = {position = {x = 986, y = 903, z = 7}, name = "spider"},
[3] = {position = {x = 987, y = 903, z = 7}, name = "snake"},
[4] = {position = {x = 988, y = 903, z = 7}, name = "bug"}
}

local function teleport()
for t = config.top_left_corner.x, config.bottom_right_corner.x do
for f = config.top_left_corner.y, config.bottom_right_corner.y do
pos = {x = t, y = f, z = 7}
pid = getTopCreature(pos).uid
if isPlayer(pid) then
doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations! Go collect your reward.")
doTeleportThing(pid, config.reward_position)
end
end
end
end

function onKill(cid, target, damage, flags)
-- check if target is player
if isPlayer(target) then
return true
end

-- check if target is on list of monsters in arena
local name = getCreatureName(target):lower()
count = 0
for i = 1, #monsters do
if name == monsters:lower() then
count = count + 1
end
end
if count == 0 then -- if target is not on list
return true
end

-- check if target is in area and add to global storage if it is
for t = config.top_left_corner.x, config.bottom_right_corner.x do
for f = config.top_left_corner.y, config.bottom_right_corner.y do
pos = {x = t, y = f, z = 7}
pid = getTopCreature(pos).uid
if pid == target then
setGlobalStorageValue(global_storage, getGlobalStorageValue(global_storage) + 1)
end
end
end

-- Start checks for waves of arena

-- Wave 1
if getGlobalStorageValue(global_storage) == 1 then
for i = 1, #monster_config_wave_one do
doCreateMonster(monster_config_wave_one.name, monster_config_wave_one.position)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 1.")
end

-- Wave 2
if getGlobalStorageValue(global_storage) == 5 then
for i = 1, #monster_config_wave_two do
doCreateMonster(monster_config_wave_two.name, monster_config_wave_two.position)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 2.")
end

-- Wave 3
if getGlobalStorageValue(global_storage) == 9 then
for i = 1, #monster_config_wave_three do
doCreateMonster(monster_config_wave_three.name, monster_config_wave_three.position)
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Wave 3. Final Wave.")
end

-- When final wave ends

-- Teleport player
if getGlobalStorageValue(global_storage) == 13 then
addEvent(teleport, 5000)
setGlobalStorageValue(global_storage, 0)
end

return true
end

registerCreatureEvent(cid, "Arena_Death")


Some error?
 
The script teleports all players, but kill the rat do not start the waves. :(

Instalation.

Action:

Creature:


Some error?
Possibly, but when I edited it, I never touched the monster check system at all, so I don't see how it couldn't not be working. :p
Sent you a pm.

Fixed via teamviewer.
5 > 1 it appears.
 
Last edited:
Hey, i'm looking for a script that you put 100x of item on the left side and pulls a lever and turns it into a different item, hope you can help with this, if anything need to be clear tell me ;)
 
Hey, i'm looking for a script that you put 100x of item on the left side and pulls a lever and turns it into a different item, hope you can help with this, if anything need to be clear tell me ;)
Sorry for the delay, I'll work on this soon.
I've seen your request for a couple days, but working on other larger scripts / work. :p
 
Hello Xikini can you make a script please like this
If player eats Marihuana(id:5953) he becomes like drunk but instead iof getting hick messages you getting "your to high to walk" message and players become RL rl high(basicaly DRUNK with disturbs moving) and after 3 minutes it finishes the high thing

I hope you understood what i meant :)
 
Hello Xikini can you make a script please like this
If player eats Marihuana(id:5953) he becomes like drunk but instead iof getting hick messages you getting "your to high to walk" message and players become RL rl high(basicaly DRUNK with disturbs moving) and after 3 minutes it finishes the high thing

I hope you understood what i meant :)
lmfao. You should make a custom client with effects in it :p
 
i think its posible to make wihtout editing client :0
He was meaning add effects while 'under the influence' I think.
hQmXC5E.gif
 
Hey, i'm looking for a script that you put 100x of item on the left side and pulls a lever and turns it into a different item, hope you can help with this, if anything need to be clear tell me ;)
Credit to myself for a custom function. :rolleyes:
Code:
<action actionid="45001" event="script" value="remove_x_items_on_pos_lever.lua"/>
Code:
local config = {

   -- item required
   take_item_id = 2544,
   take_item_count = 5,

   -- item to give
   give_item_id = 2546,
   give_item_count = 3,

   -- items position / magic effect / lever reset time
   lever_timer = 2, -- in seconds
   effect = CONST_ME_EXPLOSIONHIT,
   pos = {x = 1397, y = 1422, z = 7}

}

local function reset(p)
   doTransformItem(getTileItemById(p, 1946).uid, 1945)
end

local function getItemCountOnPosition(item, pos)
   local item_pos = {x = pos.x, y = pos.y, z = pos.z}
   local item_count = 0
   for i = 1, 255 do
     local check_pos = {x = item_pos.x, y = item_pos.y, z = item_pos.z, stackpos = i}
     if getThingFromPos(check_pos).itemid <= 0 then
       break
     elseif getThingFromPos(check_pos).itemid == item then
       if isItemStackable(getThingFromPos(check_pos).itemid) == true then
         item_count = item_count + getThingFromPos(check_pos).type
       else
         item_count = item_count + 1
       end
     end
   end  
   return item_count
end

function onUse(cid, item, fromPosition, itemEx, toPosition)

   -- check if lever is currently used
   if item.itemid == 1946 then
     return doPlayerSendTextMessage(cid, 22, "Wait for switch to reset.")
   end
  
   -- check if items are on tile
   if getItemCountOnPosition(config.take_item_id, config.pos) >= config.take_item_count then
     doRemoveItem(getTileItemById(config.pos, config.take_item_id).uid, config.take_item_count)
     addEvent(doCreateItem, 200, config.give_item_id, config.give_item_count, config.pos)
     doSendMagicEffect(config.pos, config.effect)
   else
     doSendMagicEffect(config.pos, CONST_ME_POFF)
   end
  
   -- transform lever, and add reset
   doTransformItem(item.uid, item.itemid + 1)
   addEvent(reset, config.lever_timer * 1000, toPosition)

   return true
end
 
can you explain please ?
Modify a client to have special effects on screen.
colourful / haze / blur / attract / zoom / identity focus / et cetera
He was just making a joke/statement to make the weed idea better / more promising.
 
Modify a client to have special effects on screen.
colourful / haze / blur / attract / zoom / identity focus / et cetera
He was just making a joke/statement to make the weed idea better / more promising.
so its inposible to make what i ask ?
 
so its inposible to make what i ask ?
It's very possible to script your request.
You asked me to explain, I explained.
If you need a refresh of the conversation....
Hello Xikini can you make a script please like this
If player eats Marihuana(id:5953) he becomes like drunk but instead iof getting hick messages you getting "your to high to walk" message and players become RL rl high(basicaly DRUNK with disturbs moving) and after 3 minutes it finishes the high thing

I hope you understood what i meant :)
lmfao. You should make a custom client with effects in it :p
i think its posible to make wihtout editing client :0
He was meaning add effects while 'under the influence' I think.
hQmXC5E.gif
can you explain please ?
Modify a client to have special effects on screen.
colourful / haze / blur / attract / zoom / identity focus / et cetera
He was just making a joke/statement to make the weed idea better / more promising.
 
@Xikini thanks very much for the script works perfectly :)

Edit: is it possible to add more than 1 item id that gives the same reward ?
 
Last edited:
Status
Not open for further replies.
Back
Top