• 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 1.4] Display god/player commands with talkaction

Goo Goo

Member
Joined
Apr 20, 2010
Messages
42
Reaction score
10
Just a script to display god /commands and player !commands. Saw another one but it had to be formatted in a weird way. < words= or something like that. This one can be formatted anyway you like.
You'll see what I mean when we add the files below. Formatted may not be the right word. 🤷‍♂️
You'll need to edit the files it reads from when you add or remove talkactions.

data/scripts/talkactions/commands.lua
Lua:
local playerfile = "data/scripts/talkactions/player_commands.txt" --change this to match your file path and name
local godfile = "data/scripts/talkactions/god_commands.txt" --change this to match your file path and name

local playercommands = TalkAction("!commands")
function playercommands.onSay(player, words, param)
  local commands = ""
  for line in io.lines(playerfile) do
    commands = commands..line..'\n'
  end
  player:showTextDialog(9680, commands)
  return true
end
playercommands:register()

local godcommands = TalkAction("/commands")
function godcommands.onSay(player, words, param)
  local commands = ""
  if not player:getGroup():getAccess() then
    player:sendTextMessage(MESSAGE_STATUS_WARNING,"Blasphemous!!")--Not needed, only for my amusement
    player:sendTextMessage(MESSAGE_EVENT_ADVANCE,"Use !commands instead.")--Not needed, only for my amusement
    return true
  end

  if player:getAccountType() < ACCOUNT_TYPE_GOD then
    return false
  end
  for line in io.lines(godfile) do
    commands = commands..line..'\n'
  end
  player:showTextDialog(9680, commands)
  return true
end
godcommands:register()
These next two you can put anywhere you like but for simplicity sake I'm putting them in the same folder as the script.

data/scripts/talkactions/god_commands.txt
###MOVEMENTS
/a NUMBER - teleport X tiles forward
/down - Move down a floor
/up - Move up a floor
/t - teleport to your home town
/town NAME - teleport to a town
/goto CREATURE - can be player or monster
###SPAWNING###
/c CREATURE - Teleport creature to you
/m MONSTER - spawns a monster around you
/s NPC - Spawns an NPC in front of you
###ITEMS###
/i ITEMID, COUNT - creates an item
/attr ATTRIBUTE, VALUE - set an items attribute
###PLAYERS###
/addskill PLAYER, SKILL, AMOUNT
###SERVER_MAINTENANCE###
/r - remove/delete item/tile in front of you
/clean - clean discarded items from ground
/reload SYSTEM - scripts, NPCs etc. Not recommended
/raid NAME - forces a raid to start
/B MESSAGE - server wide message broadcast
/owner - clears owner of house "evicts"
###SERVER_ADMIN###
/ghost - Go invisible
/mccheck - check for mutliclients
/addtutor NAME - Promote player to tutor
/removetutor NAME - Demote tutor to player
/openserver
/closeserver
/kick NAME - Kicks a player
/ban NAME, REASON - ban a player
/ipban - ban an IP address
/info NAME - return the info of the player

/looktype NUMBER - Change your appearance
/hide - removes your name
/summon MONSTER - Same as summon creature spell
/chameleon ITEMID - Same as chameleon rune

data/scripts/talkactions/player_commands.txt
###BANKING###
!depositall - deposit all gold to bank account
!balance - Get your bank balance
!withdraw AMOUNT - withdraw money from your bank account
###PERSONAL###
!buypremium - 10K = 90 days, max 365 days
!buyhouse -- Face door of house you want to buy
!sellhouse -- o.o
!leavehouse -- o.o
!changesex - change your sex
!kills - Unjustified kills
###SERVER###
!uptime - Displays time the server has been running
!online;/online - Displays who is online
!serverinfo - Displays server Exp, Skill, Magic, Loot Rates
!deathlist - Does it work?

First picture is to show you can format however you want. just make sure every command is on a single line.
There's a 35? character limit before the Show Text window makes a new line on it's on.
player_commands.png god_commands.png
Don't forget to edit god_commands.txt and player_commands.txt with talkactions available on your server!
Most of these are default TFS 1.4 though.
Edit: fixed an error in code.
 
Last edited:
Back
Top