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

Item Tile

Poziomek

New Member
Joined
Nov 12, 2010
Messages
16
Reaction score
0
Location
Poland Jedlicze
Hello,
I have a little problem.

ots/data/movements/scripts/questtile.lua
Code:
function onStepIn(cid, item, fromPosition, item2, toPosition)
local config = {
id1 = [B]9997[/B],
id2 = [B]9998[/B],
id3 = [B]9999[/B]
}
    if getPlayerItemCount(cid, config.id1) < 1 and getPlayerItemCount(cid, config.id2) < 1 and getPlayerItemCount(cid, config.id3) < 1 then
        doTeleportThing(cid, fromPosition)
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You don't have needed items.")
    end
return true
end

movements.xml
Code:
<movevent type="StepIn" actionid="[B]20000[/B]" event="script" value="questtile.lua"/>

I have this script but he don't work. When i have items id 9999, 9998, 9997 and I step on tile (actionid 20000) that I go, but when i don't have these items I also go but display "You don't have needed items.". Who help me? Sorry, for my English but I'm from other country.
 
LUA:
function onStepIn(cid, item, fromPosition, item2, toPosition)
local config = {
id1 = 9997,
id2 = 9998,
id3 = 9999
}
    if getPlayerItemCount(cid, config.id1) < 1 and getPlayerItemCount(cid, config.id2) < 1 and getPlayerItemCount(cid, config.id3) < 1 then
        doTeleportThing(cid, fromPosition)
else
        doPlayerSendCancel(cid, "You don't have needed items.")
    end
return true
end

Try that.
 
Code:
function onStepIn(cid, item, fromPosition, item2, toPosition)
local config = {
id1 = 9997,
id2 = 9998,
id3 = 9999
}
    if getPlayerItemCount(cid, config.id1) [COLOR="red"]>=[/COLOR] 1 and getPlayerItemCount(cid, config.id2) [COLOR="red"]>=[/COLOR] 1 and getPlayerItemCount(cid, config.id3) [COLOR="red"]>=[/COLOR] 1 then
        doTeleportThing(cid, fromPosition)
    else
        doPlayerSendCancel(cid, "You don't have needed items.")
    end
return true
end
 
Back
Top