pos = {x = 1, y = 1, z = 1}
item = {xxxx}
function onStepIn(cid, item, frompos, itemEx, topos)
if getCreaturePosition(cid) == pos.x, pos.y, pos.z and getPlayerStorageValue(cid, 700) < 1 then
doPlayerAddItem(uid, item)
doPlayerSendTextMessage(cid, 17, "Congratulations!")
doPlayerSetStorageValue(uid, 700, 1)
else
doPlayerSendCancel(cid, "You have already done this quest")
end
This should work.
LUA:pos = {x = 1, y = 1, z = 1} item = {xxxx} function onStepIn(cid, item, frompos, itemEx, topos) if getCreaturePosition(cid) == pos.x, pos.y, pos.z and getPlayerStorageValue(cid, 700) < 1 then doPlayerAddItem(uid, item) doPlayerSendTextMessage(cid, 17, "Congratulations!") doPlayerSetStorageValue(uid, 700, 1) else doPlayerSendCancel(cid, "You have already done this quest") end
<?xml version="1.0" encoding="UTF-8"?>
<mod name="ItemReward" enabled="yes">
<config name="ItemReward_config"><![CDATA[
config = {
itemid = xxxx,
count = 1,
storage = 500,
message = ""
}
]]></config>
<movevent type="StepIn" pos="100,100,7" event="buffer"><![CDATA[
domodlib('ItemReward_config')
if getPlayerStorageValue(cid, config.storage) < 1 then
doPlayerAddItem(cid, config.itemid, config.count)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.message)
setPlayerStorageValue(cid, config.storage, 1)
end
]]></movevent>
</mod>
this wont work lol..
Code:<?xml version="1.0" encoding="UTF-8"?> <mod name="ItemReward" enabled="yes"> <config name="ItemReward_config"><![CDATA[ config = { itemid = xxxx, count = 1, storage = 500, message = "" } ]]></config> <movevent type="StepIn" pos="100,100,7" event="buffer"><![CDATA[ domodlib('ItemReward_config') if getPlayerStorageValue(cid, config.storage) < 1 then doPlayerAddItem(cid, config.itemid, config.count) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.message) setPlayerStorageValue(cid, config.storage, 1) end ]]></movevent> </mod>
create multiple tiles? xD
<?xml version="1.0" encoding="UTF-8"?>
<mod name="ItemReward" enabled="yes">
<config name="ItemReward_config"><![CDATA[
config = {
[B] [COLOR="Blue"]moar items ->[/COLOR] items = {
[COLOR="Red"] {2500, 1},
{2152, 10},
{2160, 1}[/COLOR]
},[/B]
storage = 500,
message = ""
}
]]></config> [B][COLOR="Blue"]moar tiles \/[/COLOR][/B]
<movevent type="StepIn" pos="100,100,7[B][COLOR="Red"];101,100,7[/COLOR][/B]" event="buffer"><![CDATA[
domodlib('ItemReward_config')
if getPlayerStorageValue(cid, config.storage) < 1 then
[B][COLOR="Blue"]more items ->[/COLOR][/B] for _, v in ipairs(config.items) do
doPlayerAddItem(cid, v[1], v[2] or 1)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, config.message)
setPlayerStorageValue(cid, config.storage, 1)
end
]]></movevent>
</mod>
...And the stepin tile positions dont need to be changed? Or...?![]()
Now everytime I step into the tile, my server crashes
Can you make it an action or global event please?
lol+2lol'd