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

Problem with special cave

jareczekjsp

Member
Joined
Jan 30, 2023
Messages
188
Reaction score
9
GitHub
Jarek123
Otx 8.6
Hello guys I would like make special cave For Tokens
When you have tokens in backpack you can go to TP Special hunt and you can hunt(special monsters for more exprince) for time 4hours after time Player Will teleport to temple
I was looking for like that script but I can not find :(
Can Somebody help me ?,or where I can find like that script
 
Or, how to make the player take money from the backpack and throw it away after 4 hours?

function onUse(cid, item, fromPosition, itemEx, toPosition)

local pos = {x=3798, y=1031, z=12}

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
doTeleportThing(cid, pos)
doSendMagicEffect(pos, CONST_ME_TELEPORT)

return TRUE
end
 
Or what I need add when player use lever ,take tokens coin id 6526 from he backpack and moves the player to position
Post automatically merged:

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)

local pos = {x=3798, y=1031, z=12}

local magiccoin = 2158
local amount = 1

if doPlayerRemoveItem(cid, magiccoin, amount) then -- if remove itemid amountofcoins

doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

doTeleportThing(cid, pos)

doSendMagicEffect(pos, CONST_ME_TELEPORT)

end



end
 
not working;/ and no error in console
Did you register an actionid in actions.xml and put that actionid on the lever in your map editor?

---

Modified above script slightly.

If you see a 'poff' on yourself.. then that means you don't have the required item.

Lua:
local teleportPosition = {x = 3798, y = 1031, z = 12}
local magicCoinId = 2158
local amountRequired = 1

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if not doPlayerRemoveItem(cid, magicCoinId, amountRequired) then
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
        return true
    end
   
    doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
    doTeleportThing(cid, teleportPosition)
    doSendMagicEffect(teleportPosition, CONST_ME_TELEPORT)
    return true
end
 
"private" arena with monsters
u should check frompos topos
and if there is player then do not teleport.

local frompos ={x="1", y="1",z="1"}
local topos ={x="2",y="2",z="1"}

...
 
Back
Top