--[[
MAPMARK_TICK = 0,
MAPMARK_QUESTION = 1,
MAPMARK_EXCLAMATION = 2,
MAPMARK_STAR = 3,
MAPMARK_CROSS = 4,
MAPMARK_TEMPLE = 5,
MAPMARK_KISS = 6,
MAPMARK_SHOVEL = 7,
MAPMARK_SWORD = 8,
MAPMARK_FLAG = 9,
MAPMARK_LOCK = 10,
MAPMARK_BAG = 11,
MAPMARK_SKULL = 12,
MAPMARK_DOLLAR = 13,
MAPMARK_REDNORTH = 14,
MAPMARK_REDSOUTH = 15,
MAPMARK_REDEAST = 16,
MAPMARK_REDWEST = 17,
MAPMARK_GREENNORTH = 18,
MAPMARK_GREENSOUTH = 19,
]]
local mapMarks = {
[6578] = {
{
position = Position(1030, 1030, 7),
type = MAPMARK_TEMPLE,
text = "Temple"
},
{
position = Position(1040, 1040, 7),
type = MAPMARK_SHOVEL,
text = "Hunts"
},
premium = false,
storage = PlayerStorageKeys.markstorageone
},
[9941] = {
{
position = Position(1050, 1050, 7),
type = MAPMARK_FLAG,
text = "Depot"
},
{
position = Position(1060, 1060, 7),
type = MAPMARK_BAG,
text = "Quests"
},
premium = true,
storage = PlayerStorageKeys.markstoragetwo
}
}
local mapMark = Action()
function mapMark.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local minimapItems = mapMarks[item.itemid]
local playerPosition = player:getPosition()
if not player:isPremium() and minimapItems.premium then
player:sendCancelMessage("You need a premium account.")
return true
end
if player:getStorageValue(minimapItems.storage) == 1 then -- optional to avoid players using the same item once more.
player:sendCancelMessage("You have already marked this position.")
return true
end
for _, minimapItem in ipairs(minimapItems) do
player:addMapMark(minimapItem.position, minimapItem.type, minimapItem.text)
end
player:setStorageValue(minimapItems.storage, 1)
playerPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have explored and marked new maps!")
item:remove(1)
return true
end
for id, _ in pairs(mapMarks) do
mapMark:id(id)
end
mapMark:register()
Can you please explain your message ''You can change the storage to numbers instead of calling it from the lib.'' i havent fully got it what you mean.You can change the storage to numbers instead of calling it from the lib.
LUA:--[[ MAPMARK_TICK = 0, MAPMARK_QUESTION = 1, MAPMARK_EXCLAMATION = 2, MAPMARK_STAR = 3, MAPMARK_CROSS = 4, MAPMARK_TEMPLE = 5, MAPMARK_KISS = 6, MAPMARK_SHOVEL = 7, MAPMARK_SWORD = 8, MAPMARK_FLAG = 9, MAPMARK_LOCK = 10, MAPMARK_BAG = 11, MAPMARK_SKULL = 12, MAPMARK_DOLLAR = 13, MAPMARK_REDNORTH = 14, MAPMARK_REDSOUTH = 15, MAPMARK_REDEAST = 16, MAPMARK_REDWEST = 17, MAPMARK_GREENNORTH = 18, MAPMARK_GREENSOUTH = 19, ]] local mapMarks = { [6578] = { position = Position(1030, 1030, 7), type = MAPMARK_TEMPLE, text = "Temple", premium = false, storage = PlayerStorageKeys.markstorageone }, [9941] = { position = Position(1050, 1050, 7), type = MAPMARK_FLAG, text = "Depot", premium = true, storage = PlayerStorageKeys.markstoragetwo } } local mapMark = Action() function mapMark.onUse(player, item, fromPosition, target, toPosition, isHotkey) local minimapItem = mapMarks[item.itemid] local playerPosition = player:getPosition() if not player:isPremium() and minimapItem.premium then player:sendCancelMessage("You need a premium account.") return true end if player:getStorageValue(minimapItem.storage) == 1 then -- optional to avoid players using the same item once more. player:sendCancelMessage("You have already marked this position.") return true end player:addMapMark(minimapItem.position, minimapItem.type, minimapItem.text) player:setStorageValue(minimapItem.storage, 1) playerPosition:sendMagicEffect(CONST_ME_MAGIC_BLUE) player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You have explored and marked a new map!") item:remove(1) return true end for id, _ in pairs(mapMarks) do mapMark:id(id) end mapMark:register()
I meant you can changeCan you please explain your message ''You can change the storage to numbers instead of calling it from the lib.'' i havent fully got it what you mean.
PlayerStorageKeys.markstorageone to storage numbers if you are not using lib ones.I had it for 1 mark per item, edited to allow multiple marks per item.also by using 1 item i can sent multiple marks to appear ? because i try see script and it seems 1 item = 1 map mark, or im wrong ?![]()