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

[FREE] Slave Ots Free Scripting Service

Slave Ots

LUA Newbie™
Joined
Jan 19, 2012
Messages
114
Reaction score
32
Location
/goto Slave Ots
Hello Otlanders
I've Decided To Start This Thread To Help ppl Whom Just Started In Open-Tibia & Need LUA Scripts
If You Need Any Script/Help Just Post In There.....

[Note]:- Spamming or being not patient ill ignore you!

you are allowed to ask about Actions/Movements/Talkactions/Creaturescripts/GlobalEvents/Spells..

---------------------------------------------------------------------------------------------------------


hope to got REP++ when i help you!

kind regards
Slave Ots
 
ok i did that and it does not work
in your creaturescrpits/scripts make file name vocmagic.lua

and paste the script then in creaturescripts/data/login.lua post
after
Lua:
	registerCreatureEvent(cid, "GuildMotd")

paste
Lua:
	registerCreatureEvent(cid, "vocmagic")

then in your creaturescripts/creaturescripts.xml paste this
XML:
	<event type="login" name="vocmagic" event="script" value="vocmagic.lua"/>

- - - Updated - - -

Also i need one for skills and stuff to so the players have xx amount of skills when starting
 
Hey.. another quick script request, i tried to mess around with a few things. but i couldn't get it. i need a script that oncreaturedeath you get some items/tp'd to temple. thanks in advance~
 
@Jordan_August: so lets see if I have understand... Players dont die, get teleported to temple and they get items?

what i mean is when the 'boss' dies the player just gets teleported to temple, and receive items. basically they dont loot the body and so whoever like helped kill the boss would also have the same effect on them. so oncreaturedeath all players that attacked it get tp'd to temple and receive 'loot'
 
@EldinWorld: is there onStatsChange in Mystic Spirit 0.2?

@Jordan_August:

Lua:
local monsterName = "troll"
function onKill(cid, target, damage, flags)
if isPlayer(cid) and isMonster(target) and getCreatureName(target):lower == monsterName:lower then
doPlayerAddItem(cid, 2160, 1)
doTeleportThing(cid, getPlayerMasterPos(cid))
end
return true
end

And there it is... Hope it works...
 
@EldinWorld: is there onStatsChange in Mystic Spirit 0.2?

@Jordan_August:

Lua:
local monsterName = "troll"
function onKill(cid, target, damage, flags)
if isPlayer(cid) and isMonster(target) and getCreatureName(target):lower == monsterName:lower then
doPlayerAddItem(cid, 2160, 1)
doTeleportThing(cid, getPlayerMasterPos(cid))
end
return true
end

And there it is... Hope it works...

Thanks man! i hope it does too. ill test it out and let you know.

- - - Updated - - -

@EldinWorld: is there onStatsChange in Mystic Spirit 0.2?

@Jordan_August:

Lua:
local monsterName = "troll"
function onKill(cid, target, damage, flags)
if isPlayer(cid) and isMonster(target) and getCreatureName(target):lower == monsterName:lower then
doPlayerAddItem(cid, 2160, 1)
doTeleportThing(cid, getPlayerMasterPos(cid))
end
return true
end

And there it is... Hope it works...

i got this error: 2013 14:16:49] [Error - LuaScriptInterface::loadFile] data/creaturescripts/scripts/boss1.lua:3: function arguments expected near '=='
[11/02/2013 14:16:49] [Warning - Event::loadScript] Cannot load script (data/creaturescripts/scripts/boss1.lua)
[11/02/2013 14:16:49] data/creaturescripts/scripts/boss1.lua:3: function arguments expected near '=='
 
Try this:
Lua:
local monsterName = "troll"
function onKill(cid, target, damage, flags)
if (isPlayer(cid) and isMonster(target) and (string.lower(getCreatureName(target)) == string.lower(monsterName))) then
doPlayerAddItem(cid, 2160, 1)
doTeleportThing(cid, getPlayerMasterPos(cid))
end
return true
end

Hope now it works... :S
 
Try this:
Lua:
local monsterName = "troll"
function onKill(cid, target, damage, flags)
if (isPlayer(cid) and isMonster(target) and (string.lower(getCreatureName(target)) == string.lower(monsterName))) then
doPlayerAddItem(cid, 2160, 1)
doTeleportThing(cid, getPlayerMasterPos(cid))
end
return true
end

Hope now it works... :S

Awesome man! it worked 100% just what i needed :p Rep++
 
[Request]
i need a script that will keep players from getting under lvl 120.
the one i have is when layer logs in they get xx (200) lvl for example and if they get to lvl 250 or so they can log out and log back in and it dont take there lvl away but when they die and relogback in it takes them to lvl 200.. so i need one that will keep players from getting under lvl 120 but when they lvl it saves it and when they die it dont take them back to lvl 120

if no one understood that then add skype i can explain better..

Skype: blazzinn4201
 
ill be back tomorow night,, so all wi get support

alright, hello man, i need some mid/hard thing, i want a talkaction, that when you say for example !quest it show up a message showing the progress of some quest (storage value), and showing a diferent text for each number of storage

example, i got storage 10000 with 1, so the script will show up "You need to take the sword", and after you do that the storage 10000 set to 2 and then it show up "You already have taked the sword", of course the talkaction doesnt do anything about quest, just check the value of a storage and depending on the number it show up a message

something like that, and really thanks for services like this
 
Here We Are :)
Lua:
local level = 717171 -- the min level
local cost = 1000000 -- the needed money
function onSay(cid, words, param, channel)
		if(getPlayerLevel(cid) >= level) and (doPlayerRemoveMoney(cid, cost) == TRUE) and (isInArray({9, 10, 11, 12, 22}, getPlayerVocation(cid))) then
					doCreatureSetStorage(cid, 85987, getCreatureStorage(cid, 85987) == -1 and 1 or getCreatureStorage(cid, 85987) + 1)
					doRemoveCreature(cid)
					db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` ='"..id.."';")
					db.executeQuery("UPDATE `players` SET `name` = '"..getCreatureName(cid).."' WHERE `id` ='"..getPlayerGUID(cid).."';")
				else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. " and " .. cost .. " gold.")
end
end
end
	return true
end

Tell Me if it works, i didn't test , and tell me if not work too :)

Rep++ If It Helpful For You

- - - Updated - - -

alright, hello man, i need some mid/hard thing, i want a talkaction, that when you say for example !quest it show up a message showing the progress of some quest (storage value), and showing a diferent text for each number of storage

example, i got storage 10000 with 1, so the script will show up "You need to take the sword", and after you do that the storage 10000 set to 2 and then it show up "You already have taked the sword", of course the talkaction doesnt do anything about quest, just check the value of a storage and depending on the number it show up a message

something like that, and really thanks for services like this
Here We Are :)
Lua:
local storage = 10000
local msg1 = "You need to take the super sword" -- this is message if get player storage 10000 = 1
local msg2 = "You already have taked the super sword" -- this is message if get player storage 10000 = 2
function onSay(cid, words, param, channel)

        if getPlayerStorageValue(cid, storage) == 1 then
		doPlayerSendTextMessage(cid,25,msg1)
		elseif getPlayerStorageValue(cid, storage) == 2 then
		doPlayerSendTextMessage(cid,25,msg2)
		end
		return true
  end

that's what i think you need , if it which you need and it works or not work ,report back to me here :)
Rep++ If It Helpful For You
 
Last edited:
not working this error come up

14/02/2013 19:10:25] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/rebirth.lua:13: '<eof>' expected near 'end'
[14/02/2013 19:10:25] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/rebirth.lua)


and only 1 request per person?? because I need Highscore in game for rebirth Like write !top and will get top 5 rebirth I have no idea what is the high in my one ;p
 
Last edited:
Here We Are :)
Lua:
local level = 717171 -- the min level
function onSay(cid, words, param, channel)
		if(getPlayerLevel(cid) >= level) then
					doCreatureSetStorage(cid, 85987, getCreatureStorage(cid, 85987) == -1 and 1 or getCreatureStorage(cid, 85987) + 1)
					doRemoveCreature(cid)
					db.executeQuery("UPDATE `players` SET `level` = 8, `experience` = 4200, `healthmax` = 2000, `manamax` = 2000, `promotion` = 0 WHERE `id` ='"..id.."';")
					db.executeQuery("UPDATE `players` SET `name` = '"..getCreatureName(cid).."' WHERE `id` ='"..getPlayerGUID(cid).."';")
				else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You need level " .. level .. ".")
end
	return true
end

Tell me please if it worked or not ;)
 
Last edited:
I need mod of change. Something like

Changemap in 2 minutes, next map Carlin.

Clearly this message is two minutes before map change.

And when change the map

Map has been changed, next map in 20 minutes.

Code:
<?xml version="1.0" encoding="UTF-8"?>  
<mod name="ChangeMap" version="1.0" author="Vodkart" contact="xtibia.com" enabled="yes">  
<config name="map_func"><![CDATA[  
 
                      info = {  
                      [0] = {x=654,y=847,z=7},
                      [1] = {x=517,y=602,z=7},
                      [2] = {x=552,y=226,z=7},
                      [3] = {x=789,y=308,z=7},
                      [4] = {x=250,y=180,z=7},
                      [5] = {x=413,y=804,z=7},
                      [6] = {x=763,y=550,z=7},
                      [7] = {x=900,y=849,z=7},
                      [8] = {x=920,y=487,z=7}
                        }

                        storage = 50555  
 
]]></config> 
<event type="login" name="Check Map" event="script"><![CDATA[  
domodlib('map_func')  
        function onLogin(cid) 
        if getGlobalStorageValue(storage) == -1 then 
        setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)  
        end 
        doTeleportThing(cid,info[getGlobalStorageValue(storage)])   
        return true  
end  
]]></event> 
        <globalevent name="ChangeMap" interval="1200" event="script"><![CDATA[  
        domodlib('map_func')  
        function onThink(interval, lastExecution)  
                doBroadcastMessage('El mapa sera cambiado nuevamente en 20 minutos.')
                if getGlobalStorageValue(storage) < 5 then  
                setGlobalStorageValue(storage,getGlobalStorageValue(storage)+1)   
                else  
                setGlobalStorageValue(storage,getGlobalStorageValue(storage)-5)
                end  
                for _, pid in ipairs(getPlayersOnline()) do
                doRemoveConditions(pid, true)   
	doSendMagicEffect(getCreaturePosition(pid), 37)
	doCreatureAddHealth(pid, getCreatureMaxHealth(pid))
	doCreatureAddMana(pid, (getCreatureMaxMana(pid) - getCreatureMana(pid)))
                doTeleportThing(pid,info[getGlobalStorageValue(storage)])    
                end   
         return TRUE  
end]]></globalevent> 
</mod>
 
oh sorry now get lev 717171 write !rebirth and only this is writing 20:30 You need level 717171 and 0 gold.
and i have level 20:32 You are level : ----> 717217 <----

- - - Updated - - -

local config = {
price = 0, -- Price of first rebirth
priceIncrease = 0, -- Works as 'price' + current rebirths * priceIncrease.
rebirthLevel = 717171, -- Level for first rebirth.
rebirthIncrease = 0, -- Works as 'rebirthLevel' + current rebirths * rebirthIncrease.
maxRebirths = 10000000, -- Number of times a player can rebirth.
level = 1000, -- The level the player is set to apon rebirth.
healthPercent = 1.00, -- 1.00 = 100%.
health = 100, -- Only used if 'healthPercent' = 0.
manaPercent = 1.00, -- 1.00 = 100%.
mana = 100, -- Only used if 'manaPercent' = 0.
keepSkills = true, -- Wether players keep skills and level apon rebirth.
skillLevel = 10, -- Only used if 'keepSkills' = false.
magicLevel = 0, -- Only used if 'keepSkills' = false.
capacity = 10000, -- The capacity players are set to apon rebirth.
templePos = {x = 2000, y = 2000, z = 7}, -- The place where players reset to should there town id return 0.
storage = 85987 -- Player storage rebirth count is kept on.
}

local focuses = {}
local function isFocused(cid)
for i, v in pairs(focuses) do
if(v == cid) then
return true
end
end
return false
end

local function addFocus(cid)
if(not isFocused(cid)) then
table.insert(focuses, cid)
end
end
local function removeFocus(cid)
for i, v in pairs(focuses) do
if(v == cid) then
table.remove(focuses, i)
break
end
end
end
local function lookAtFocus()
for i, v in pairs(focuses) do
if(isPlayer(v)) then
doNpcSetCreatureFocus(v)
return
end
end
doNpcSetCreatureFocus(0)
end

function onCreatureDisappear(cid)
if(isFocused(cid)) then
selfSay("Goodbye.")
removeFocus(cid)
end
end

function onCreatureSay(cid, type, msg)
if((msg == "hi") and not (isFocused(cid))) then
selfSay("Welcome, ".. getCreatureName(cid) ..".", cid, true)
selfSay("I can {rebirth} you!", cid)
addFocus(cid)
status = 1
elseif((isFocused(cid)) and (msg == "rebirth") and (status == 1)) then
if (getCreatureStorage(cid, config.storage) < config.maxRebirths) then
storage = getCreatureStorage(cid, config.storage)
rebirthLevel = config.rebirthLevel + (config.rebirthIncrease * storage)
if (getPlayerLevel(cid) >= rebirthLevel) then
money = config.price + (config.priceIncrease * storage)
if (getPlayerMoney(cid) >= money) then
selfSay("I can rebirth you for " .. money .. " gold.", cid)
selfSay("Do you want me to rebirth you?", cid)
status = 2
else
selfSay("You need at least " .. money .. " gold before you can rebirth.", cid)
status = 1
end
else
selfSay("You need to be at least level " .. rebirthLevel .. " before you can rebirth.", cid)
status = 1
end
else
selfSay("It seems you can not rebirth anymore.", cid)
status = 1
end
elseif((isFocused(cid)) and (msg == "yes") and (status == 2)) then
selfSay("Ok then i will rebirth you.", cid)
selfSay("You will now be logged out.", cid)
doPlayerRemoveMoney(cid, money)
addEvent(doRebirthPlayer, 2000, {cid=cid})
removeFocus(cid)
elseif((isFocused(cid)) and (msg == "no") and (status == 2)) then
selfSay("Maybe one day you will wise up and change your mind!", cid)
status = 1
elseif((isFocused(cid)) and (msg == "bye" or msg == "goodbye" or msg == "cya")) then
selfSay("Goodbye!", cid, true)
removeFocus(cid)
end
end

function onPlayerCloseChannel(cid)
if(isFocused(cid)) then
selfSay("Goodbye.")
removeFocus(cid)
end
end

function onThink()
for i, focus in pairs(focuses) do
if(not isCreature(focus)) then
removeFocus(focus)
else
local distance = getDistanceTo(focus) or -1
if((distance > 4) or (distance == -1)) then
selfSay("Goodbye.")
removeFocus(focus)
end
end
end
lookAtFocus()
end

function doRebirthPlayer(cid)
cid = cid.cid
if (cid == nil) then
return true
end

local guid = getPlayerGUID(cid)

if (config.healthPercent > 0) then
health = getCreatureMaxHealth(cid) * config.healthPercent
else
health = config.health
end
if (config.manaPercent > 0) then
mana = getCreatureMaxMana(cid) * config.manaPercent
else
mana = config.mana
end
if (getPlayerTown(cid) > 0) then
pos = getTownTemplePosition(getPlayerTown(cid))
else
pos = config.templePos
end


doCreatureSetStorage(cid, config.storage, getCreatureStorage(cid, config.storage) + 1)
doRemoveCreature(cid, true)
db.executeQuery("UPDATE `players` SET level = " .. config.level .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET cap = " .. config.capacity .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET health = " .. health .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET healthmax = " .. health .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET mana = " .. mana .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET manamax = " .. mana .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET posx = " .. pos.x .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET posy = " .. pos.y .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `players` SET posz = " .. pos.z .. " WHERE id = " .. guid .. ";")

if (not config.keepSkills) then
db.executeQuery("UPDATE `players` SET maglevel = " .. config.magicLevel .. " WHERE id = " .. guid .. ";")
db.executeQuery("UPDATE `player_skills` SET value = " .. config.skillLevel .. " WHERE id = " .. guid .. ";")
end
return true
end
this is my npc for that if it would help you but I dont want rebirth limit on !rebirth :)
 
Back
Top