📓
TFS Guide
  • Preface
  • Progress
  • Unique TFS Concepts
  • Interface - Actions
    • Registration
    • Scripting
    • Revscriptsys
  • Interface - Chatchannels
    • Registration
    • Scripting
  • Interface - Creaturescripts
    • Registration
    • Scripting
    • Revscriptsys
  • Interface - Events
    • Registration
    • Scripting
  • Interface - Globalevents
    • Registration
    • Scripting
    • Revscriptsys
  • Interface - Monster
    • Registration
    • Scripting
    • Revscriptsys
  • Interface - Movements
    • Registration
    • Scripting
    • Revscriptsys
  • Interface - NPC
    • Registration
    • Scripting
  • Interface - Spells
    • Registration
    • Scripting
  • Interface - Talkactions
    • Registration
    • Scripting
  • Interface - Weapons
    • Registration
    • Scripting
  • Source Editing
    • Creating new events
    • Creating new Lua functions
  • Function Documentation
    • Game
Powered by GitBook
On this page
  • Structure
  • Example

Was this helpful?

  1. Interface - Chatchannels

Scripting

Structure

canJoin(player)

Parameters:

  • player: Player attempting to join the channel.

Return Value:

  • true: Player will be allowed to join the channel.

  • false: Player will not be allowed to join the channel.

onSpeak(player, type, message)

Parameters:

  • player: Player who is speaking.

  • type: Talk type (SpeakClasses enum in const.h).

  • message: Message being sent to the channel.

Return Value:

  • Talk type (SpeakClasses enum in const.h)

  • TALKTYPE_SAY

    TALKTYPE_WHISPER

    TALKTYPE_YELL

    TALKTYPE_PRIVATE_FROM

    TALKTYPE_PRIVATE_TO

    TALKTYPE_CHANNEL_Y

    TALKTYPE_CHANNEL_O

    TALKTYPE_PRIVATE_NP

    TALKTYPE_PRIVATE_PN

    TALKTYPE_BROADCAST

    TALKTYPE_CHANNEL_R1

    TALKTYPE_PRIVATE_RED_FROM

    TALKTYPE_PRIVATE_RED_TO

    TALKTYPE_MONSTER_SAY

    TALKTYPE_MONSTER_YELL

    TALKTYPE_CHANNEL_R2

Example

function canJoin(player)
	return player:getName() == "Delusion"
end

function onSpeak(player, type, message)
	-- Force orange messages no matter what in the channel
	return TALKTYPE_CHANNEL_O
end
PreviousRegistrationNextRegistration

Last updated 5 years ago

Was this helpful?