• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

can someone edit or add new function to this script?

CipsoftStinks

www.relicaria.com
Joined
Oct 1, 2016
Messages
946
Solutions
3
Reaction score
138
Location
Argentina
hello
well my script works but it need a missing feature
atm if i pull the lever and the player its standing where the sqm will change (a normal sqm by a hole)
the player stays "floating"when he should had fell down
can someone add this feature please?

Code:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
    gettile1 = getThingfromPos(tile1)
    if item.actionid == 4016 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(427, 1, tile1)   
        doTransformItem(item.uid, item.itemid+1)
    elseif item.actionid == 4016 and item.itemid == 1946 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(351, 1, tile1)
        doTransformItem(item.uid, item.itemid-1)   
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end

    return true
end
 
Try this:
LUA:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
    gettile1 = getThingfromPos(tile1)

    if item.actionid == 4016 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(427, 1, tile1)
        doTransformItem(item.uid, item.itemid+1)
        doTeleportThing(cid, tile1+{0,1,0}, false)
    elseif item.actionid == 4016 and item.itemid == 1946 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(351, 1, tile1)
        doTransformItem(item.uid, item.itemid-1)
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end

    return true
end

And as @Qbazzz said it's good way just simply add:
LUA:
doTeleportThing(cid, tile1+{0,1,0}, false)
in script in place when player should go down (im not sure if I added this correctly so change the line where it should be placed)

default doTeleportThing is:
LUA:
doTeleportThing(cid, newpos[, pushmove = true[, fullTeleport = true]])
cid - who
newpos - position where the "who" should go
pushmove - force teleport
fullTeleport - show "magic effect" of teleport

So if you have magic effect change ,false to ,false,false .
 
Try this:
LUA:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
    gettile1 = getThingfromPos(tile1)

    if item.actionid == 4016 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(427, 1, tile1)
        doTransformItem(item.uid, item.itemid+1)
        doTeleportThing(cid, tile1+{0,1,0}, false)
    elseif item.actionid == 4016 and item.itemid == 1946 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(351, 1, tile1)
        doTransformItem(item.uid, item.itemid-1)
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end

    return true
end

And as @Qbazzz said it's good way just simply add:
LUA:
doTeleportThing(cid, tile1+{0,1,0}, false)
in script in place when player should go down (im not sure if I added this correctly so change the line where it should be placed)

default doTeleportThing is:
LUA:
doTeleportThing(cid, newpos[, pushmove = true[, fullTeleport = true]])
newpos - position where the "who" should go
pushmove - force teleport
fullTeleport - show "magic effect" of teleport

So if you have magic effect change ,false to ,false,false .
the player sholdnt be teleported he should fell down if he it standing in the sqm that will change when someone pull the lever
i'll test your script. ty a lot
 
the player sholdnt be teleported he should fell down if he it standing in the sqm that will change when someone pull the lever
i'll test your script. ty a lot
Yea but what he's saying is the same you will get teleported down the hole when your using the lever the person using the lever wont see the difference.
 
Try this:
LUA:
function onUse(cid, item, frompos, item2, topos)
    tile1 = {x = 32225, y = 32276, z = 8, stackpos = 0}
    gettile1 = getThingfromPos(tile1)

    if item.actionid == 4016 and item.itemid == 1945 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(427, 1, tile1)
        doTransformItem(item.uid, item.itemid+1)
        doTeleportThing(cid, tile1+{0,1,0}, false)
    elseif item.actionid == 4016 and item.itemid == 1946 then
        doRemoveItem(gettile1.uid, 1)
        doCreateItem(351, 1, tile1)
        doTransformItem(item.uid, item.itemid-1)
    else
        doPlayerSendCancel(cid, "Sorry, not possible.")
    end

    return true
end

And as @Qbazzz said it's good way just simply add:
LUA:
doTeleportThing(cid, tile1+{0,1,0}, false)
in script in place when player should go down (im not sure if I added this correctly so change the line where it should be placed)

default doTeleportThing is:
LUA:
doTeleportThing(cid, newpos[, pushmove = true[, fullTeleport = true]])
cid - who
newpos - position where the "who" should go
pushmove - force teleport
fullTeleport - show "magic effect" of teleport

So if you have magic effect change ,false to ,false,false .
ill test the script ty man!
 
Back
Top