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

TFS 0.X How to detect when players change the arrow slot item?

dawnking

Member
Joined
Jun 23, 2016
Messages
176
Reaction score
22
I want to run a script when players change the item from ammo slot
How to do it?
 
Solution
could show me how to if player equip the item id 123 to arrow slot, send him to temple

Lua:
-- <movevent type="Equip" itemid="XXX" event="script" value="script.lua"/>
function onEquip(cid, item, slot, boolean)
    local pos = {x = 0, y = 0, z = 0}
    if slot == CONST_SLOT_AMMO then
        doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
        doTeleportThing(cid, pos)
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end
    return true
end
could show me how to if player equip the item id 123 to arrow slot, send him to temple

Lua:
-- <movevent type="Equip" itemid="XXX" event="script" value="script.lua"/>
function onEquip(cid, item, slot, boolean)
    local pos = {x = 0, y = 0, z = 0}
    if slot == CONST_SLOT_AMMO then
        doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
        doTeleportThing(cid, pos)
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end
    return true
end
 
Solution
Lua:
-- <movevent type="Equip" itemid="XXX" event="script" value="script.lua"/>
function onEquip(cid, item, slot, boolean)
    local pos = {x = 0, y = 0, z = 0}
    if slot == CONST_SLOT_AMMO then
        doSendMagicEffect(getThingPosition(cid), CONST_ME_POFF)
        doTeleportThing(cid, pos)
        doSendMagicEffect(pos, CONST_ME_TELEPORT)
    end
    return true
end
ty
 
Back
Top