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

Lua Anyone know what's up with this script?

GhostX

Mapping Board Moderator
Joined
Nov 2, 2011
Messages
6,051
Reaction score
1,819
Location
UK
Twitch
ghostxpr0
Ok, so it's basically my first legit/propper script. I had a little help from fallen explaining some functions because i am new to this.

I also ran it though lua.org's lua demo test run program and it came through clear. So i then added to a server to try it out.

The script is meant to provide map marks when the hangable minimap is used with AID "xxxx" (i have this in the actions.xml)

The issue is, when i use the hangable map, it says "cannot use this item" or something similar, and no errors are produced in the console. The same happens when i try with other items.. E.g. i tested on pirate hat aswell.

LUA:
--[[ Script by Ghostx... 
Use minimap receive map marks
]]--
function onUse(cid, item, fromPosition, itemEx, toPosition)

local Mark = {
[1]={{x=1019,y=1044,z=7},"Temple",MAPMARK_TEMPLE},
[2]={{x=1024,y=1015,z=7},"Depot",MAPMARK_LOCK},
[3]={{x=1024,y=1007,z=7},"Equipment",MAPMARK_SWORD},
[4]={{x=1015,y=1017,z=7},"Hunting Shop",MAPMARK_STAR},
[5]={{x=1019,y=1005,z=7},"Castle",MAPMARK_FLAG},
[6]={{x=1009,y=1015,z=7},"Potion Shop",MAPMARK_TICK},
[7]={{x=992,y=1011,z=7},"Wilderness",MAPMARK_REDWEST},
[8]={{x=1056,y=1011,z=7},"Docks",MAPMARK_BAG}
}
for i=1,#Mark do
doPlayerAddMapMark(cid, Mark[i][1], Mark[i][3], Mark[i][2]) 
doPlayerSendTextMessage(cid,21,"You now have locations marked on your map")
end
return true
end

XML:
 <action actionid="65535" script="other/mapmarking.lua"/>
*ACTIONID// thanks for wavoz for noticing this error, though problem still exists*

Any help to why it isn't working and what is missing (if there is) will be much appreciated.

Regards
 
Last edited:
<action uniqueid="65535" script="other/mapmarking.lua"/>

You have registered this by unique ID, you should use unique id on your useable item or just register it as action id.

<action actionid="65535" script="other/mapmarking.lua"/>
 
oh yh it has it on the unique id also anyway :P i didn't notice that - stupid moment. But i think i used action id when i tested on pirate hat etc. So i still think the problem remains
 
No of course use it with or without credits i don't really care :>

Hmm idk why wont work for me.. Maybe it's my distro.. i'll try another

- - - Updated - - -

yup was my distro.
 
Back
Top