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

Solved Help me add effects to this script

megachock

Member
Joined
Mar 12, 2009
Messages
115
Reaction score
7
Well it is my script, im just new on scripting and when i try to put effects in this it dont works, can someone help me?

Lua:
local ppos = {x = 1917, y = 934, z = 10}
local red = {
    inips = {x = 1912, y = 932, z = 10, stackpos=1},
    pos = {x = 1911, y = 935, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9976
}
local blue = {
    inips = {x = 1912, y = 933, z = 10, stackpos=1},
    pos = {x = 1911, y = 932, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9977
}
local lblue = {
    inips = {x = 1912, y = 934, z = 10, stackpos=1},
    pos = {x = 1911, y = 934, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9978
}
local green = {
    inips = {x = 1912, y = 935, z = 10, stackpos=1},
    pos = {x = 1911, y = 933, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9979
}
 
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local pred = getThingFromPos(red.pos)
local pblue = getThingFromPos(blue.pos)
local plblue = getThingFromPos(lblue.pos)
local pgreen = getThingFromPos(green.pos)
 
    if pred.itemid == red.items and pblue.itemid == blue.items and plblue.itemid == lblue.items and pgreen.itemid == green.items then
          doSendMagicEffect(ppos,2)
          doTeleportThing(cid, ppos)
    doRemoveItem(getTileItemById(red.pos,red.items).uid)
     doCreateItem(red.items, 1, red.inips)
    doRemoveItem(getTileItemById(blue.pos,blue.items).uid)
     doCreateItem(blue.items, 1, blue.inips)
    doRemoveItem(getTileItemById(lblue.pos,lblue.items).uid)
     doCreateItem(lblue.items, 1, lblue.inips)
    doRemoveItem(getTileItemById(green.pos,green.items).uid)
     doCreateItem(green.items, 1, green.inips)
 
          doPlayerSendTextMessage(cid,21,"Nice matematics!")
 
 
    else
        doPlayerSendCancel(cid, "The position of the items is wrong!")
    end
return true
end
 
Lua:
local ppos = {x = 1917, y = 934, z = 10}
local red = {
    inips = {x = 1912, y = 932, z = 10, stackpos=1},
    pos = {x = 1911, y = 935, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9976,
    effect = 1
}
local blue = {
    inips = {x = 1912, y = 933, z = 10, stackpos=1},
    pos = {x = 1911, y = 932, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9977,
    effect = 1
}
local lblue = {
    inips = {x = 1912, y = 934, z = 10, stackpos=1},
    pos = {x = 1911, y = 934, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9978,
    effect = 1
}
local green = {
    inips = {x = 1912, y = 935, z = 10, stackpos=1},
    pos = {x = 1911, y = 933, z = 10, stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE},
    items = 9979,
    effect = 1
}
 
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
 
local pred = getThingFromPos(red.pos)
local pblue = getThingFromPos(blue.pos)
local plblue = getThingFromPos(lblue.pos)
local pgreen = getThingFromPos(green.pos)
 
    if pred.itemid == red.items and pblue.itemid == blue.items and plblue.itemid == lblue.items and pgreen.itemid == green.items then
          doSendMagicEffect(ppos,2)
          doTeleportThing(cid, ppos)
    doRemoveItem(getTileItemById(red.pos,red.items).uid)
     doCreateItem(red.items, 1, red.inips)
     doSendMagicEffect(getPlayerPosition(cid), red.effect)
     ------------ Blue ---------------
    doRemoveItem(getTileItemById(blue.pos,blue.items).uid)
     doCreateItem(blue.items, 1, blue.inips)
     doSendMagicEffect(getPlayerPosition(cid), blue.effect)
     ------------ Blue1 ---------------
    doRemoveItem(getTileItemById(lblue.pos,lblue.items).uid)
     doCreateItem(lblue.items, 1, lblue.inips)
     doSendMagicEffect(getPlayerPosition(cid), 1blue.effect)
     ------------ Green ---------------
    doRemoveItem(getTileItemById(green.pos,green.items).uid)
     doCreateItem(green.items, 1, green.inips)
     doSendMagicEffect(getPlayerPosition(cid), green.effect)
 
          doPlayerSendTextMessage(cid,21,"Nice matematics!")
 
 
    else
        doPlayerSendCancel(cid, "The position of the items is wrong!")
    end
return true
end
i edit your script have easy config.. just only edit effect = 1
for other number , you can see all effect in your command: /z 1
/z 2 ,etc.. use this command on you god.
 
Back
Top