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

Effect on use weapon

Grading

New Member
Joined
Apr 27, 2014
Messages
7
Reaction score
0
I need a script for a ring, that when I put it generates a certain effect and when I remove it, the effect disappears
 
Inside your data\globalevents\scripts create Lua script file and name it WeaponEffect.lua and add this to it
Lua:
function onThink(interval)
for _, cid in ipairs(getPlayersOnline()) do
            if getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == YOURWEAPONID or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == YOURWEAPONID then
                doSendMagicEffect(getCreaturePosition(cid), 65)
            end
        end
    return true
end
Change YOURWEAPONID to your weapon ID number.
and in data\globalevents\globalevents.xml add this
XML:
<globalevent name="WeaponEffect" interval="10000" script="WeaponEffect.lua"/>
interval="10000" is time in MS
 
Inside your data\globalevents\scripts create Lua script file and name it WeaponEffect.lua and add this to it
Lua:
function onThink(interval)
for _, cid in ipairs(getPlayersOnline()) do
            if getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == YOURWEAPONID or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == YOURWEAPONID then
                doSendMagicEffect(getCreaturePosition(cid), 65)
            end
        end
    return true
end
Change YOURWEAPONID to your weapon ID number.
and in data\globalevents\globalevents.xml add this
XML:
<globalevent name="WeaponEffect" interval="10000" script="WeaponEffect.lua"/>
interval="10000" is time in MS
man thanx i loviu. And sorry friend will it also work for tfs 3.7?
 
Last edited:
Back
Top