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

Help with scripts

cuba

New Member
Joined
Feb 24, 2015
Messages
136
Reaction score
2
@Summ @Limos @heba @Evan @Printer @dominique120 @Cornex

hello otlander today i want some scripts and i hope to get it


1-Demote level (when i say /demote playername all server see message player name has demoted "..level.."

2-auto remove wall with level (when i use lever the wall count down 1 mint and close again)

3-text over teleports (but text only no effects)

4-how can i make item gives 2% protection form all+give5% max hp/mana


Sorry for your time
 
about wall remove
Code:
local positions = {
   {x=1000, y=1007, z=7}, ---wall postion
   {x=1000, y=1010, z=7} ---wall postion
}
local wallid = 1546  --wall id

local function doCreateWalls()
   for x = 1, #positions do
     doCreateItem(wallid, 1, positions[x])
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             addEvent(doCreateWalls, 30 * 1000) --- time to creat wall again
             doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
         else
             doPlayerSendCancel(cid, "The walls are already removed.")
         end
     end
     return true
end

text on tp u can use somthing like this

Code:
--[[
    Talking Tp/signs/tiles for TFS 0.3+
    by (Herotom)
]]--
    local text = {
    --X pos,Y pos, Z pos, text
    [1] = {pos = {1000,998,7}, text = {"Welcome"}}

      


    }
    local effects = {
    --X pos,Y pos, Z pos, text
        [2] = {pos = {995,1006,7}, effect = {61}}

    }
function onThink(interval, lastExecution)
    for _, area in pairs(text) do
        doSendAnimatedText({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.text[1], math.random(01,255))
    end
    for _, area in pairs(effects) do
        doSendMagicEffect({x=area.pos[1],y=area.pos[2],z=area.pos[3]},area.effect[1])
    end
    return TRUE
end

about items u can use something like this
Code:
</item>    <item id="8880" article="a" name="upgraded rich armor">
        <attribute key="armor" value="1250" />
        <attribute key="absorbPercentDeath" value="10" />
        <attribute key="absorbPercentFire" value="10" />
        <attribute key="absorbPercentice" value="10" />
        <attribute key="absorbPercentphysical" value="10" />
        <attribute key="absorbPercentenergy" value="10" />
        <attribute key="absorbPercentholy" value="10" />
        <attribute key="maxhealthpercent" value="110"/>
        <attribute key="maxmanapercent" value="110"/>
        <attribute key="description" value="faster regeneration." />
        <attribute key="weight" value="8450" />
        <attribute key="slotType" value="body" />
    </item>
this items give 10% mana and hp
in movement
Code:
    <movevent type="Equip" itemid="8880" slot="armor" level="60" event="function" value="onEquipItem">
showInDescription="faster regeneration"/>
        showInDescription="0"/>
    </movevent>
    <movevent type="DeEquip" itemid="8880" slot="armor" event="function" value="onDeEquipItem"/>
 
Code:
local positions = {
   {x=1000, y=1007, z=7},
   {x=1000, y=1010, z=7}
}
local cfg = {
                {
                    time = 30, -- Seconds until tp closes.
                    tp = { x=1000, y=1007, z=7 } -- Where the wall creat.
                },
            }
        }
    }
local wallid = 1546

local function doCreateWalls()
   for x = 1, #positions do
     doCreateItem(wallid, 1, positions[x])
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             addEvent(doCreateWalls, 30 * 1000)
             doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
         else
             doPlayerSendCancel(cid, "The walls are already removed.")
         end
         for x = 1, c.time do
        local n = c.time - x
            addEvent(doSendAnimatedText, x * 1000, c.tp, n > 0 and tostring(n), TEXTCOLOR_TEAL)
            end
     end
     return true
end
 
Code:
local positions = {
   {x=1000, y=1007, z=7},
   {x=1000, y=1010, z=7}
}
local cfg = {
                {
                    time = 30, -- Seconds until tp closes.
                    tp = { x=1000, y=1007, z=7 } -- Where the wall creat.
                },
            }
        }
    }
local wallid = 1546

local function doCreateWalls()
   for x = 1, #positions do
     doCreateItem(wallid, 1, positions[x])
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             addEvent(doCreateWalls, 30 * 1000)
             doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
         else
             doPlayerSendCancel(cid, "The walls are already removed.")
         end
         for x = 1, c.time do
        local n = c.time - x
            addEvent(doSendAnimatedText, x * 1000, c.tp, n > 0 and tostring(n), TEXTCOLOR_TEAL)
            end
     end
     return true
end
[12/03/2015 15:37:23] [Error - LuaScriptInterface::loadFile] data/actions/scripts/other/bridge lever.lua:11: unexpected symbol near '}'
[12/03/2015 15:37:23] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/other/bridge lever.lua)
[12/03/2015 15:37:23] data/actions/scripts/other/bridge lever.lua:11: unexpected symbol near '}'
 
Too many brackets.... Try this, I altered the one above to fix the error...


Code:
local positions = {
   {x=1000, y=1007, z=7},
   {x=1000, y=1010, z=7}
}
local cfg = {
                {
                    time = 30, -- Seconds until tp closes.
                    tp = { x=1000, y=1007, z=7 } -- Where the wall creat.
                },
            }
           
local wallid = 1546

local function doCreateWalls()
   for x = 1, #positions do
     doCreateItem(wallid, 1, positions[x])
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             addEvent(doCreateWalls, 30 * 1000)
             doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
         else
             doPlayerSendCancel(cid, "The walls are already removed.")
         end
         for x = 1, c.time do
        local n = c.time - x
            addEvent(doSendAnimatedText, x * 1000, c.tp, n > 0 and tostring(n), TEXTCOLOR_TEAL)
            end
     end
     return true
end
 
Too many brackets.... Try this, I altered the one above to fix the error...


Code:
local positions = {
   {x=1000, y=1007, z=7},
   {x=1000, y=1010, z=7}
}
local cfg = {
                {
                    time = 30, -- Seconds until tp closes.
                    tp = { x=1000, y=1007, z=7 } -- Where the wall creat.
                },
            }
          
local wallid = 1546

local function doCreateWalls()
   for x = 1, #positions do
     doCreateItem(wallid, 1, positions[x])
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             addEvent(doCreateWalls, 30 * 1000)
             doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
         else
             doPlayerSendCancel(cid, "The walls are already removed.")
         end
         for x = 1, c.time do
        local n = c.time - x
            addEvent(doSendAnimatedText, x * 1000, c.tp, n > 0 and tostring(n), TEXTCOLOR_TEAL)
            end
     end
     return true
end
works but its not count down like 3-2-1
 
sorry
Code:
local positions = {
   {x=1000, y=1007, z=7},
   {x=1000, y=1010, z=7}
}
      
local wallid = 1546

local function doCreateWalls()
   for x = 1, #positions do
     doCreateItem(wallid, 1, positions[x])
   end
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
     for x = 1, #positions do
         local wall = getTileItemById(positions[x], wallid).uid
         if wall > 0 then
             doRemoveItem(wall, 1)
             addEvent(doCreateWalls, 30 * 1000)
             doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945)
         else
             doPlayerSendCancel(cid, "The walls are already removed.")
         end
         for x = 1, 29 do
      addEvent(doSendAnimatedText, x * 1000, {x=1000, y=1007, z=7}, 30 - x, COLOR_RED)
            end
     end
     return true
end
 
Last edited:
@heba
[12/03/2015 16:15:29] [Error - Action Interface]
[12/03/2015 16:15:29] data/actions/scripts/other/bridge lever.lua:eek:nUse
[12/03/2015 16:15:29] Description:
[12/03/2015 16:15:29] data/actions/scripts/other/bridge lever.lua:30: attempt to index global 'c' (a nil value)
[12/03/2015 16:15:29] stack traceback:
[12/03/2015 16:15:29] data/actions/scripts/other/bridge lever.lua:30: in function <data/actions/scripts/other/bridge lever.lua:20>


put this script on actions or global?
 
use my script up now i edite this and i can't write demote now im busy i write and work and read in one time :)
 
okay when u be free tell me about all and why when i go remers and put item on it it says unbale to create items position 1000 1000 6

bumb
 
Last edited by a moderator:
nono its count but count in
x=1000, y=1007, z=7 change it to wall postion here
addEvent(doSendAnimatedText, x * 1000, {x=1000, y=1007, z=7}, 30 - x, COLOR_RED)
 
Back
Top Bottom