• 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 Tfs 1.3 disappearing monsters when

Dorianek

Member
Joined
Nov 29, 2018
Messages
247
Reaction score
10
Location
Poland
Hello, I need a very simple script for TFS 1.3 that makes monsters disappear when they pass through (smoke ID "1505")
Screen for attention:
 

Attachments

By disappear you mean the normal monsters' invisible defense? or you mean monsters get removed?
 
create a file called smoke.lua and place inside your scripts folder
Lua:
local smokeEvent = MoveEvent()

function smokeEvent.onStepIn(creature, item, pos, fromPosition)
    if not creature:isMonster() then
        return false
    end

    pos:sendMagicEffect(CONST_ME_POFF)
    creature:remove()
    return true
end

smokeEvent:id(1505)
smokeEvent:register()
 
this script is invalid...
why? becouse right now all smokes will remove monsters...
better way is using actionid and set aid in script and smoke, in this way only specific(defined by player) smoke will remove monsters
 
he didn't really specify if wanted all or some of them, so you can't say it's invalid, but yes if you want it that way just register it by actionid or check for positions instead.

btw if need further adjustments, let me know : )
 
he didn't really specify if wanted all or some of them, so you can't say it's invalid, but yes if you want it that way just register it by actionid or check for positions instead.

btw if need further adjustments, let me know : )

Hello.. how would the script look like?
Where is the folder where the file is going to be put?
 
Hello.. how would the script look like?
Where is the folder where the file is going to be put?
removes monster when it steps on this item
XML:
<item id="1505" name="smoke">
    <attribute key="type" value="magicfield" />
    <attribute key="replaceable" value="false" />
</item>

should be placed in here:
data/scripts/movements

and if you want it to trigger on specific tiles you need to register it via actionid instead and add that id to the map aswell, or you can modify the script to check for positions, up to you.

hope that helps :) gl
 
Back
Top