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

Need mod support

Ecstacy

Mothafuckaaa
Joined
Dec 26, 2008
Messages
3,836
Reaction score
108
Location
The Netherlands
Hey,

can you use locals in mods?
I have never used mods before and made an attempt, but I can't call geThingPos(cid) in the config <_<.
 
You can never load: geThingPos(cid)
It is: getThingPos(cid)

Also how can you do it in config if there is no cid.
You can just load it in function:
local pos = getThingPos(cid)
 
it be like this
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="Monster Quest" version="1.0" author="Damadgerz" contact="[email protected]" enabled="yes">
<config name="tutorial_m"><![CDATA[
pos = balabalba   -- no local here
monster ={ ["rat"] = {storage = 2313},["rat"] = {storage = 2314} }

 ]]></config>
<talkaction words="!start" event="script"><![CDATA[
 domodlib('tutorial_m')   --you type this to get configrations from the monster and pos
   local stor = monster[param]  -- you can use local in the script it self
 doTeleportThing(cid,pos)
 setPlayerStorageValue(cid,monster.storage)

 ]]></talkaction>

</mod>
 
Hey,

can you use locals in mods?
I have never used mods before and made an attempt, but I can't call geThingPos(cid) in the config <_<.


Maybe because you are using the wrong function, here's the correct one.


yours
LUA:
geThingPos(cid)

There's no (cid) in this function, maybe you mean (pos)?

mine
LUA:
getThingfromPos or getThingFromPos(pos)
 
You can never load: geThingPos(cid)
It is: getThingPos(cid)

Also how can you do it in config if there is no cid.
You can just load it in function:
local pos = getThingPos(cid)

It was just a miss-spell ^_^

And thanks all for help :p (+rep)

Could someone also tell me the difference between "script" and "buffer"?
 
event="script/buffer"?

If you have event="script" you need to set value as the script file like this: value="a.lua"
If you set event="buffer" you can directly set a short action in the .xml file:
value="doPlayerSay(cid,"Sometext")"
or any other function
 
Back
Top