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

Sirion_Mido Free Scripting Service (Actions/Movements/Talkactions/Creaturescripts)

Sirion_Mido

Experienced Member
Joined
Jul 22, 2012
Messages
579
Reaction score
43
Location
E-G-Y-P-T
Hello,

I decide to make scripts depending on players request like cyko , just i do that because cyko closed his theard , so i can continue if anyone want.

Follow these rules and we are good to go!

Rule number 1: No Spamming!
Rule number 2: Be Patient!
Rule number 3: There is no rule number 3!
Rule number 4: Follow all these rules!

As far you can see i accept only Actions/Movements/Talkactions/Creaturescripts.

Rep++ If It Helpful For You..
 
Last edited:
Can you do regrouping room? Teleport moves you to special position and works only when leader of guild first step in this tp. If leader step out room, all players are moving to temple. If in room is some guild, tp move next leader to another room.
Sorry for my Engilsh.
 
ummmm
need a code to get from online players the player who have the highest value of xx storage. if the vip storage for example is 11551 i need code to get the player who have the highest vip days. also if 2 players have the same days its ok.
thx
 
This might do it 7i7a
Lua:
local vipPlayer = 11157

local storageForVip = vipStorage


function onSay(cid, word, param)	
	local player, storage, vip = {}, {}, {}
	local players = getPlayersOnline()
	for i, pid in ipairs(players) do
		local storageVip = getPlayerStorageValue(cid, sotrageForVip)
		local tmp = table.find(storage, vip)
		if(tmp ~= nil and) then
			if(table.countElements(player, storageVip) == 0) then
				player[players[tmp]] = storageVip
			end
			player[pid] = storageVip
		end

		table.insert(storage, storageVip)
	end

	if(table.maxn(player) > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "The player with the highest vip days is:")
		for pid, ip in pairs(player) do
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, getCreatureName(pid) .. ".")
		end
	end

	return true
end
 
7i7a
Lua:
local str = 123 -- vip storage
function onSay(cid, word, param)	
	local t = {}
	for _, cid in ipairs(getPlayersOnline()) do
		if getCreatureStorage(cid, str) > 0 then
			table.insert(t, cid)
		end
	end
	table.sort(t, function(k, v)
		return getCreatureStorage(k, str) > getCreatureStorage(v, str)
	end)
	return doPlayerSendTextMessage(cid, 19, getPlayerName(t[1]) ..' => '.. getCreatureStorage(t[1], str))
end
 
Script to never loose the skull?
Normal: when PZ off skull is off...

With Script: when PZ off skull continue and can enter to protection zones of course
 
im not at home now , so try this script i just made it now , and im not at home so i can test it or fix bugs , try this:X
Lua:
local t = {
	monster = {"Demon", {pos.y = topos.y + 1}},
        itemid = 2545,
	msg = "It's too quiet here..."
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerStorageValue(cid, t.storage) < 1 then       
		doCreatureSay(cid, t.msg, TALKTYPE_ORANGE_1)
		doSummonCreature(t.monster[1], t.monster[2])
		doPlayerRemoveItem(cid, t.itemid, 1)
	end
	return TRUE
end
 
try this bro im at home now :pP
test this and reply back tell me if it works or no
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local cfg = {
	monster = {"Demon", {getThingPos(cid)}},
	msg = "Demon"
}
	if not isPremium(cid) then
    doPlayerSendCancel(cid, "You need premium days to use this item")	
	else
	
		doCreatureSay(cid, cfg.msg, TALKTYPE_ORANGE_1)
		doSummonCreature(cfg.monster[1], cfg.monster[2])
		doRemoveItem(item.uid, 1)
	end
	return TRUE
end
 
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/spawnrune.lua:onUse

data/actions/scripts/spawnrune.lua:11: attempt to call global 'doCreatureSay' <a nil value>

By the way, i have 8.1
XML:
 engine, maybe this causing problem?
 
try this one ... , you didn't tell us that's for 8.1 .........
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local cfg = {
	monster = {"Demon", {getThingPos(cid)}}
}
	if not isPremium(cid) then
    doPlayerSendCancel(cid, "You need premium days to use this item")	
	else
	
		doSummonCreature(cfg.monster[1], cfg.monster[2])
		doRemoveItem(item.uid, 1)
	end
	return TRUE
end
reply back to me , tell me if it works or no...
 
Code:
Lua Script Error: [Action Interface]
data/actions/scripts/spawnrune.lua:onUse

luaDoSummonCreature<>. Can not summon monster: Demon

Still nothing.. rune only dissapear after use.

@edit
I have one more simple request:

"script which add 1 magic lvl"
 
for the first request listen i dont know if there functions.lua in lib in 8.1 , but if there go to functions.lua in your lib and add this code
Lua:
function doSummonCreature(name, pos, displayError)
	local displayError, cid = displayError or true, doCreateMonster(name, pos, false, false, displayError)
	if(not cid) then
		cid = doCreateNpc(name, pos, displayError)
	end
if no work or work , i will get for you the another request

another point , do you have monster call demon in your server? -.-
 
I dont even have "functions.lua" in my "data\actions\lib".. only file i have there is "actions.lua".

actions.lua
Code:
ROPE_SPOT = {384, 418}

OPENED_HOLE = {294, 383, 469, 470, 482, 482, 485, 489}

CLOSED_HOLE = {468, 481, 483}

OPENED_TRAP = {462}

DOWN_LADDER = {369, 370, 408, 409, 427, 428, 3135, 3136, 5545, 5763}

WATER_WITH_FISH = {490, 4608}

WATER_WITHOUT_FISH = {491, 492, 493, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4664, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825}

JUNGLE_GRASS = {2782, 3985}

LIQUID_CONTAINER = {1775, 2005, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2023, 2031, 2032, 2033, 2034, 2562, 2574, 2575, 2576, 2577, 3941, 3942}

WATER = {490, 4608, 491, 492, 493, 618, 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, 629, 4609, 4610, 4611, 4612, 4613, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4664, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825} 

MUD = {103, 351, 352, 353, 354, 355}

LAVA = {598, 599, 600, 601, 1509}

SWAMP = {602, 603, 604, 605, 4691, 4692, 4693, 4694, 4695, 4696, 4697, 4698, 4699, 4700, 4701, 4702, 4703, 4704, 4705, 4706, 4707, 4708, 4709, 4710, 4711, 4712, 4749, 4750, 4751, 4752, 4753, 4754, 4755, 4758}

NORMAL_CORPSE_STAGE_I = {2317, 2806, 2808, 2813, 2820, 2824, 2826, 2830, 2835, 2839, 2844, 2848, 2849, 2853, 2860, 2862, 2864, 2866, 2871, 2876, 2881, 2886, 2889, 2893, 2905, 2908, 2914, 2920, 2924, 2928, 2931, 2935, 2938, 2940, 2945, 2960, 2967, 2969, 2972, 2979, 2981, 2983, 2985, 2987, 2992, 2995, 3019, 3043, 3046, 3055, 3058, 3065, 3067, 3069, 3073, 3077, 3080, 3084, 3086, 3090, 3095, 3099, 3104, 3109, 3113, 3119, 3128, 3129, 4251, 4253, 4256, 4259, 4262, 4265, 4268, 4271, 4274, 4277, 4280, 4283, 4286, 4289, 4292, 4295, 4298, 4301, 4304, 4307, 4310, 4314, 4317}

SWAMP_CORPSE_STAGE_I = {2807, 2817, 2857, 2897, 2899, 2902, 3004, 3007, 3010, 3013, 3077, 4289, 4313, 4320}

OVEN_ON = {1786, 1788, 1790, 1792}

LADDER = {1386, 3678, 5543}

CLOSED_NORMAL_DOOR = {1210, 1213, 1232, 1235, 1250, 1253, 3536, 3545, 4914, 4917, 5099, 5108, 5117, 5126, 5135, 5138, 5141, 5144}

OPENED_NORMAL_DOOR = {1211, 1214, 1233, 1236, 1251, 1254, 3537, 3546, 4915, 4918, 5100, 5109, 5117, 5118, 5136, 5139, 5142, 5145}

CLOSED_LOCKED_DOOR = {1219, 1221, 1237, 1239, 3538, 3547, 5082, 5084, 5101, 5110, 5119, 5128}

OPENED_LOCKED_DOOR = {1220, 1222, 1238, 1240, 3539, 3548, 5083, 5085, 5102, 5111, 5120, 5129}

CLOSED_LEVEL_DOOR = {1227, 1229, 1245, 1247, 1259, 1261, 3540, 3549, 5103, 5112, 5121, 5130}

OPENED_LEVEL_DOOR = {1228, 1230, 1246, 1248, 1260, 1262, 3541, 3550, 5104, 5113, 5122, 5131}

CLOSED_QUEST_DOOR = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132}

OPENED_QUEST_DOOR = {1224, 1226, 1242, 1244, 1256, 1258, 3543, 3552, 5106, 5115, 5124, 5133}

DECAYTO_ITEM_INCREMENT = {2041, 2044, 2047, 2050, 2052, 2054, 5812}

function exhaust(cid, storevalue, exhausttime)
-- Exhaustion function by Alreth, v1.1 2006-06-24 01:31
-- Returns 1 if not exhausted and 0 if exhausted
    
    newExhaust = os.time()
    oldExhaust = getPlayerStorageValue(cid, storevalue)
    if (oldExhaust == nil or oldExhaust < 0) then
        oldExhaust = 0
    end
    if (exhausttime == nil or exhausttime < 0) then
        exhausttime = 1
    end
    diffTime = os.difftime(newExhaust, oldExhaust)
    if (diffTime >= exhausttime or diffTime < 0) then
        setPlayerStorageValue(cid, storevalue, newExhaust) 
        return 1
    else
        return 0
    end
end

Of course i have "demon" on my server :D
 
why you using that shit client version? :p
anyways that is the second requset , i not change much cuz no time :p , so use it xd
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local cfg = {
	amount = 1
}
	if not isPremium(cid) then
    doPlayerSendCancel(cid, "You need premium days to use this item")	
	else
	
		doPlayerAddMagLevel(cid, cfg.amount)
		doRemoveItem(item.uid, 1)
	end
	return TRUE
end
 
Im using 8.1
XML:
 cuz i dont like messing with SQL.

Second Request:

[CODE]data/actions/scripts/magiclvl.lua:10: attempt to call global 'doPlayerAddMagLevel' <a nil value>

Lua Script Error: [Action Interface]
data/actions/scripts/magiclvl.lua:onUse
 
Okay... any advice? I wish to move on newest client but i just HATE SQL.. alot of downloading, alot of setting up and other sh*t..
 
Back
Top