local marks = {
[1] = {
{Position(1000, 1000, 7), MAPMARK_EXCLAMATION, "Temple"},
},
[2] = {
{Position(886, 987, 7), MAPMARK_EXCLAMATION, "Lava Golems"},
},
[3] = {
{Position(994, 1085, 7), MAPMARK_EXCLAMATION, "Losts"},
},
[4] = {
{Position(15386, 15197, 8), MAPMARK_EXCLAMATION, "DeathStrike"},
},
[5] = {
{Position(5290, 5221, 8), MAPMARK_EXCLAMATION, "Mad Mage"},
},
[6] = {
{Position(5417, 5462, 7), MAPMARK_EXCLAMATION, "Glooth Slasher"},
},
[7] = {
{Position(5552, 5586, 8), MAPMARK_EXCLAMATION, "Hellflayer"},
},
}
function onLogin(player)
if player:getLastLoginSaved() <= 0 then
for i = 1, #marks do
player:addMapMark(marks[i][1], marks[i][2], marks[i][3])
end
end
return true
end
Where do I put this script?here you go
Lua:local marks = { [1] = { {Position(1000, 1000, 7), MAPMARK_EXCLAMATION, "Temple"}, }, [2] = { {Position(886, 987, 7), MAPMARK_EXCLAMATION, "Lava Golems"}, }, [3] = { {Position(994, 1085, 7), MAPMARK_EXCLAMATION, "Losts"}, }, [4] = { {Position(15386, 15197, 8), MAPMARK_EXCLAMATION, "DeathStrike"}, }, [5] = { {Position(5290, 5221, 8), MAPMARK_EXCLAMATION, "Mad Mage"}, }, [6] = { {Position(5417, 5462, 7), MAPMARK_EXCLAMATION, "Glooth Slasher"}, }, [7] = { {Position(5552, 5586, 8), MAPMARK_EXCLAMATION, "Hellflayer"}, }, } function onLogin(player) if player:getLastLoginSaved() <= 0 then for i = 1, #info.marks do player:addMapMark(info.marks[i][1], info.marks[i][2], info.marks[i][3]) end end return true end
creaturescripts.xmlWhere do I put this script?
In version 0.4 I used it in movement, but now in 1.2 I don't know how it works!
<event type="login" name="mapmarks" script="mapmarks.lua" />
here you go
Lua:local marks = { [1] = { {Position(1000, 1000, 7), MAPMARK_EXCLAMATION, "Temple"}, }, [2] = { {Position(886, 987, 7), MAPMARK_EXCLAMATION, "Lava Golems"}, }, [3] = { {Position(994, 1085, 7), MAPMARK_EXCLAMATION, "Losts"}, }, [4] = { {Position(15386, 15197, 8), MAPMARK_EXCLAMATION, "DeathStrike"}, }, [5] = { {Position(5290, 5221, 8), MAPMARK_EXCLAMATION, "Mad Mage"}, }, [6] = { {Position(5417, 5462, 7), MAPMARK_EXCLAMATION, "Glooth Slasher"}, }, [7] = { {Position(5552, 5586, 8), MAPMARK_EXCLAMATION, "Hellflayer"}, }, } function onLogin(player) if player:getLastLoginSaved() <= 0 then for i = 1, #info.marks do player:addMapMark(info.marks[i][1], info.marks[i][2], info.marks[i][3]) end end return true end
Change
for i = 1, #info.marks do
for i = 1, #marks do
There was no error in the distribution, but it did not "create" the markeditted main post re-copy should work now
local mapMarks = {
{pos = Position(1000, 1000, 7), type = MAPMARK_EXCLAMATION, text = "Temple"},
{pos = Position(886, 987, 7), type = MAPMARK_EXCLAMATION, text = "Lava Golems"},
{pos = Position(994, 1085, 7), type = MAPMARK_EXCLAMATION, text = "Losts"},
{pos = Position(15386, 15197, 8), type = MAPMARK_EXCLAMATION, text = "DeathStrike"},
{pos = Position(5290, 5221, 8), type = MAPMARK_EXCLAMATION, text = "Mad Mage"},
{pos = Position(5417, 5462, 7), type = MAPMARK_EXCLAMATION, text = "Glooth Slasher"},
{pos = Position(5552, 5586, 8), type = MAPMARK_EXCLAMATION, text = "Hellflayer"},
}
function onLogin(player)
if player:getLastLoginSaved() <= 0 then
for _, mark in pairs(mapMarks) do
player:addMapMark(mark.pos, mark.type, mark.text)
end
end
return true
end
<event type="login" name="mapmarks" script="mapmarks.lua" />
player:registerEvent("mapmarks")
local marks = {
[1] = {
{Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "Temple"},
}
}
function onLogin(player)
if player:getLastLoginSaved() <= 0 then
for i = 1, #marks do
player:addMapMark(marks[i][1], marks[i][2], marks[i][3])
end
end
return true
end
if it wasn't new character this script works only with new chars, if it was new then in data/creaturescripts/scripts/login.luaThere was no error in the distribution, but it did not "create" the mark
onLogin events don't need to be registered to a player.if it wasn't new character this script works only with new chars, if it was new then in data/creaturescripts/scripts/login.lua
add this line near the end
player:registerEvent("mapmarks")
debugged client, and no error appears in the distroLua:local mapMarks = { {pos = Position(1000, 1000, 7), type = MAPMARK_EXCLAMATION, text = "Temple"}, {pos = Position(886, 987, 7), type = MAPMARK_EXCLAMATION, text = "Lava Golems"}, {pos = Position(994, 1085, 7), type = MAPMARK_EXCLAMATION, text = "Losts"}, {pos = Position(15386, 15197, 8), type = MAPMARK_EXCLAMATION, text = "DeathStrike"}, {pos = Position(5290, 5221, 8), type = MAPMARK_EXCLAMATION, text = "Mad Mage"}, {pos = Position(5417, 5462, 7), type = MAPMARK_EXCLAMATION, text = "Glooth Slasher"}, {pos = Position(5552, 5586, 8), type = MAPMARK_EXCLAMATION, text = "Hellflayer"}, } function onLogin(player) if player:getLastLoginSaved() <= 0 then for _, mark in pairs(mapMarks) do player:addMapMark(mark.pos, mark.type, mark.text) end end return true end
Also keep in mind that the marks will only be added if a character has never logged in before.
https://otland.net/threads/tfs-1-2-8-0.263797/
No workChange
for i = 1, #info.marks do
to
for i = 1, #marks do
Remove line 6 and 10 if you want the map mark to always appear when someone logs in, otherwise only new characters will recieve the map markscreaturescripts.xml
login.luaXML:<event type="login" name="mapmarks" script="mapmarks.lua" />
mapmarks.luaLua:player:registerEvent("mapmarks")
Lua:local marks = { [1] = { {Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "Temple"}, } } function onLogin(player) if player:getLastLoginSaved() <= 0 then for i = 1, #marks do player:addMapMark(marks[i][1], marks[i][2], marks[i][3]) end end return true end
local marks = {
{Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "Temple"},
}
function onLogin(player)
if player:getLastLoginSaved() <= 0 then -- remove if want always
for i = 1, #marks do
player:addMapMark(marks[i][1], marks[i][2], marks[i][3])
end
end -- remove if want always
return true
end
The client is debugging the first time of the login, and then he enters normally but the mark does not appear.Remove line 6 and 10 if you want the map mark to always appear when someone logs in, otherwise only new characters will recieve the map marks
Lua:local marks = { {Position(1011, 1023, 7), MAPMARK_EXCLAMATION, "Temple"}, } function onLogin(player) if player:getLastLoginSaved() <= 0 then -- remove if want always for i = 1, #marks do player:addMapMark(marks[i][1], marks[i][2], marks[i][3]) end end -- remove if want always return true end
I really don't know..The client is debugging the first time of the login, and then he enters normally but the mark does not appear.
View attachment 47297
Only other thing I can suggest to try is to use numbers instead of direct text?mhm, my client marks.
View attachment 47298
{Position(1011, 1023, 7), 3, "Temple"},
Not work, debug. I'm thinking that it's something related to the client and not the script. Or maybe in version 8.0 it would have different names for these marks.Only other thing I can suggest to try is to use numbers instead of direct text?
idk why that would change anything though.
{Position(1011, 1023, 7), 3, "Temple"},
Yeah, must be the client.Not work, debug. I'm thinking that it's something related to the client and not the script. Or maybe in version 8.0 it would have different names for these marks.