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

Erexo free Scripting Service (All) {Inspirated by Otswe}

Erexo

Kage
Premium User
Joined
Mar 27, 2010
Messages
741
Solutions
5
Reaction score
193
Location
Pr0land
GitHub
Erexo
Hello guys!
Otswe inspired me to start this topic.
Im not a pr0 lua scripter, anyways if someone have small script request i always can help :)

So feel free for asking, i can teach something too :)
 
Last edited:
Well, use use any item id and any storage value, when you give me an example i will figure out to add more, do you agree?

Here u are:
test.jpg

Lua:
local config = {
{["value"] = -1, ["text"] = "You must start the quest first"},
{["value"] = 1, ["text"] = "Go to basement and kill 10 rats"},
{["value"] = 2, ["text"] = "Back to Sam and talk with him"}
}
local storage = 8000 -- Quest storage ID
local itemID = 1950 -- Item ID showing in the left top corner of the text
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, #config do
	if getPlayerStorageValue(cid,storage) == config[i].value then
		doShowTextDialog(cid, itemID, config[i].text)
	end
end
return true
end
 
Here u are:
View attachment 14570

Lua:
local config = {
{["value"] = -1, ["text"] = "You must start the quest first"},
{["value"] = 1, ["text"] = "Go to basement and kill 10 rats"},
{["value"] = 2, ["text"] = "Back to Sam and talk with him"}
}
local storage = 8000 -- Quest storage ID
local itemID = 1950 -- Item ID showing in the left top corner of the text
function onUse(cid, item, fromPosition, itemEx, toPosition)
for i = 1, #config do
	if getPlayerStorageValue(cid,storage) == config[i].value then
		doShowTextDialog(cid, itemID, config[i].text)
	end
end
return true
end

Alright, thank you
 
I kinda dont understand, but if u wanna make action whos doesnt working on Npvp zone just add:
Lua:
local playerPos = getPlayerPosition(cid)
If getTileZoneInfo(playerPos) == 1 then
 doSendMagicEffect(playerPos, CONST_ME_POFF)
 doPlayerSendTextMessage(cid, 22, 'You cannot use that item in protection zone!')
else
--SCRIPT HERE--
end
 
Cześć :)
Możesz zrobić skrypt który bedzie wyświetlał po nicku, lvlu itp. range która jest zależna od skilla fish ?

Kiedy mamy 50 fishing:
NP. You see yourself. You are a Druid. You are Fisherman.

Kiedy sprawdzamy kogoś:
NP. You see Pleyer Test (Level 346). He is a Knight. Hi is a Fisherman.

Przykładowe Rangi
10-49 fishing = Weak Fisherman
50-99 fishing = Fisherman
100-149 fishing = Good Fisherman
150 fishing = Master Fisherman
 
Here u are,
creaturescripts.xml
XML:
	<event type="look" name="rang" event="script" value="rang.lua"/>

login.lua
Lua:
registerCreatureEvent(cid, "rang")

rang.lua
Lua:
function onLook(cid, thing, position, lookDistance)
local prefix = "" -- By Erexo
if isPlayer(thing.uid) then
 prefix = "He is a"
else
 return true
end
local ranga = ""
if getPlayerSkillLevel(thing.uid, SKILL_FISHING) >= 50 and getPlayerSkillLevel(thing.uid, SKILL_FISHING) <= 99 then
 ranga = "Fisherman"
elseif getPlayerSkillLevel(thing.uid, SKILL_FISHING) >= 100 and getPlayerSkillLevel(thing.uid, SKILL_FISHING) <= 149 then
 ranga = "Good Fisherman"
elseif getPlayerSkillLevel(thing.uid, SKILL_FISHING) >= 150 then
 ranga = "Master Fisherman"
else
 ranga = "Weak Fisherman"
end
 doPlayerSetSpecialDescription(thing.uid, ". " .. prefix .. " " .. ranga)
return true
end
Not tested but should works.
 
Well this is a script for a quest let me explain.
Ok the quest its about two quest, in the top there are two interruptors that should be on to open a teleport that lead to the prizen room
Note that each of the interruptors are in one tower i mean one interruptor per tower
A tp will appear and it will disappear in 5 min

1. you clic on interruptor
2. then another
3. when two of the interruptor have been activated the portal with appear then it will desaper before 5 min

ty Erexo :)
 
Delete after time:
you must only set values of:
itemidToRemove
positionFromWhichWeWantRemove


addEvent(function(itemid,pos) local thing = getTileItemById(pos, itemid) if(thing.uid > 0) then doRemoveItem(thing.uid) end end, 5 * 60 * 1000, itemidToRemove, positionFromWhichWeWantRemove)

More readable version (both work):
Lua:
addEvent(function(itemid,pos)
    local thing = getTileItemById(pos, itemid)
    if(thing.uid > 0) then
        doRemoveItem(thing.uid)
    end
end,
5 * 60 * 1000,
itemidToRemove,
positionFromWhichWeWantRemove)
delete time 5 min = 5 * 60 * 1000
 
i wanna script action

when player use rune ItemID: 12570 than

the Position of player will save than

after 10 sec player will back to old Position and make player say bye bye
 
i wanna script action

when player use rune ItemID: 12570 than

the Position of player will save than

after 10 sec player will back to old Position and make player say bye bye

Lua:
function onUse(cid, item, frompos, item2, topos)
local position = getCreaturePosition(cid)
local function back(cid)
doPlayerSay(cid,"bye bye",TALKTYPE_SAY)
doTeleportThing(cid, position, true)
doSendMagicEffect(getCreaturePosition(cid), 3)
return true
end
addEvent(back,10*1000,cid)
doSendMagicEffect(pos, 3)
end

Not tested
 
Here u are,
creaturescripts.xml
XML:
	<event type="look" name="rang" event="script" value="rang.lua"/>

login.lua
Lua:
registerCreatureEvent(cid, "rang")

rang.lua
Lua:
function onLook(cid, thing, position, lookDistance)
local prefix = "" -- By Erexo
if isPlayer(thing.uid) then
 prefix = "He is a"
else
 return true
end
local ranga = ""
if getPlayerSkillLevel(thing.uid, SKILL_FISHING) >= 50 and getPlayerSkillLevel(thing.uid, SKILL_FISHING) <= 99 then
 ranga = "Fisherman"
elseif getPlayerSkillLevel(thing.uid, SKILL_FISHING) >= 100 and getPlayerSkillLevel(thing.uid, SKILL_FISHING) <= 149 then
 ranga = "Good Fisherman"
elseif getPlayerSkillLevel(thing.uid, SKILL_FISHING) >= 150 then
 ranga = "Master Fisherman"
else
 ranga = "Weak Fisherman"
end
 doPlayerSetSpecialDescription(thing.uid, ". " .. prefix .. " " .. ranga)
return true
end
Not tested but should works.

Działa ale tylko w połowie ponieważ gdy damy look na siebie nic nie pisze ;c
 
Delete after time:
you must only set values of:
itemidToRemove
positionFromWhichWeWantRemove


addEvent(function(itemid,pos) local thing = getTileItemById(pos, itemid) if(thing.uid > 0) then doRemoveItem(thing.uid) end end, 5 * 60 * 1000, itemidToRemove, positionFromWhichWeWantRemove)

More readable version (both work):
Lua:
addEvent(function(itemid,pos)
    local thing = getTileItemById(pos, itemid)
    if(thing.uid > 0) then
        doRemoveItem(thing.uid)
    end
end,
5 * 60 * 1000,
itemidToRemove,
positionFromWhichWeWantRemove)
delete time 5 min = 5 * 60 * 1000


uhhh what? :S
erexo help here D:
 
Back
Top