TFS Development Hub

everything_you_need

action.lua
local myAction = Action()

function myAction.onUse(player, item, fromPosition,
    target, toPosition, isHotkey)
    
    player:sendTextMessage(MESSAGE_INFO_DESCR, 
        "Welcome to TFS Development!")
    
    return true
end

myAction:id(2000)
myAction:register()

complete_tfs_dev_suite

everything_you_need

available_now

Script Generator

Generate custom TFS scripts with detailed descriptions in seconds. Supports actions, movements, events, and more.

ai_powered_generation
multiple_tfs_versions
Generate Script
available_now

Script Analyzer

Upload your scripts for AI-powered analysis, get optimization recommendations and error detection.

file_explorer_integration
enhanced_error_detection
Analyze Script
coming_soon

Data Editor

Edit XML files, monster definitions, item attributes and more with an intuitive, AI-assisted interface.

coming_soon

TFS Documentation

Comprehensive, searchable documentation for all TFS versions, with examples and best practices.

TFS Module Types

Explore the various script modules available in The Forgotten Server

RevScriptSys Format
local doorAction = Action()

function doorAction.onUse(player, item, fromPosition, target, toPosition, isHotkey)
    -- Check if player has key
    if player:getItemCount(2086) > 0 then
        -- Open the door
        item:transform(item:getId() + 1)
        item:decay()
        return true
    end
    
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You need a key to open this door.")
    return false
end

doorAction:id(5000)
doorAction:register()

Actions

Action scripts are triggered when a player uses an item in the game. They can be attached to specific item IDs or action IDs.

Item interaction handling
Custom mechanics development
Support for both item ID and action ID
Generate Actions
RevScriptSys Format
local teleport = MoveEvent()

function teleport.onStepIn(creature, item, position, fromPosition)
    local player = creature:getPlayer()
    if not player then
        return false
    end
    
    -- Teleport player to destination
    local destination = Position(100, 100, 7)
    player:teleportTo(destination)
    position:sendMagicEffect(CONST_ME_TELEPORT)
    destination:sendMagicEffect(CONST_ME_TELEPORT)
    
    return true
end

teleport:aid(2000)
teleport:register()

Movements

Movement scripts are triggered when a creature steps on a tile or moves an item. They are essential for teleports, quest areas, and more.

Teleportation systems
Area restriction handling
Item movement control
Generate Movements
RevScriptSys Format
local creatureEvent = CreatureEvent("PlayerLogin")

function creatureEvent.onLogin(player)
    -- Send welcome message
    player:sendTextMessage(MESSAGE_STATUS_DEFAULT, "Welcome to the server " .. player:getName() .. "!")
    
    -- Give daily reward if eligible
    local lastLogin = player:getStorageValue(40001)
    local currentTime = os.time()
    
    if lastLogin < os.time() - 86400 then
        player:addItem(2160, 1) -- Give 1 crystal coin
        player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You received your daily reward!")
        player:setStorageValue(40001, currentTime)
    end
    
    return true
end

creatureEvent:register()

Creature Events

Creature event scripts handle events related to creatures like player login/logout, death, advance, and more.

Login/logout handling
Death and kill trackers
Level advancement rewards
Generate Creature Events
RevScriptSys Format
local talkAction = TalkAction("/heal")

function talkAction.onSay(player, words, param)
    if not player:isPremium() then
        player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need a premium account to use this command.")
        return false
    end
    
    -- Set player health and mana to maximum
    player:addHealth(player:getMaxHealth() - player:getHealth())
    player:addMana(player:getMaxMana() - player:getMana())
    
    -- Send magic effect
    player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
    player:sendTextMessage(MESSAGE_INFO_DESCR, "You have been healed.")
    
    return false
end

talkAction:separator(" ")
talkAction:register()

Talk Actions

Talk action scripts handle player chat commands, enabling custom functionality through text input.

Custom player commands
Admin and staff tools
Parameter handling
Generate Talk Actions
RevScriptSys Format
local globalEvent = GlobalEvent("ServerSave")

function globalEvent.onTime()
    -- Announce the server save
    Game.broadcastMessage("Server save will occur in 5 minutes. Please logout to ensure your progress is saved.", MESSAGE_STATUS_WARNING)
    
    -- Schedule the server save
    addEvent(function()
        Game.broadcastMessage("Server save in progress...", MESSAGE_STATUS_WARNING)
        -- Save all players
        for _, player in ipairs(Game.getPlayers()) do
            player:save()
        end
        Game.broadcastMessage("Server save completed. Thank you for your patience.", MESSAGE_STATUS_WARNING)
    end, 5 * 60 * 1000) -- 5 minutes
    
    return true
end

globalEvent:time("12:00")
globalEvent:register()

Global Events

Global event scripts handle server-wide events like startup, shutdown, record online, and scheduled events.

Timed server events
Server startup procedures
Recurring global activities
Generate Global Events

tfs_development_stats

tfs_stats_description

539
Scripts Generated
63
tfs_scripts_analyzed
0
TFS Versions Supported

Ready to transform your TFS development?

Generate your first AI-powered script and experience the future of Tibia server development

Start Creating Now