User:Thundermaker300/TM-A/Doc

This page contains a documentation of magic that you can do using the admin. You have to do something before you can start interacting with TM-A. You have to get something called the "main table". This table contains all the properties, methods, and events used to manipulate TM-A how you want.

To get this table...
 * 1) This table is given to you in custom commands, use "main" in your custom command to access it.
 * 2) If not using in a custom command, use this line of code to get the main table:

'''Warning: You can not directly get the main table on client. Using #2 above will return nil on client.'''

After getting the main table, you can use all of the following members however you want.

Properties
Access these by using main.prop.[NAME]

This property is always the default prefix set in settings. Produces the same result as main.methods.GetSetting("Prefix").

Methods
Access these by using main.methods.[NAME]

Returns TM-A's current version.

Returns an array of Players that could be found in the given string 'find'. This allows for all things such as 'me','others','random', and commas between users. The speaker argument is required for 'me' and 'others'.

Returns the given player's admin rank.

Returns true if the given player has admin (does not include VIP).

Sets the name of the player above their head to newName.

Attempts to char the player 'plr' as the person with the name 'playerName' (they do not have to be in-game). Returns "Success!" if successful, otherwise returns.

Displays a message, with the name of the message being pName, the icon of the message being pIcon, the message being message, and the message lasts duration seconds.

Displays a list to the given plr. Inside the item array, there must be more arrays. In each of those arrays, there are 3 items. The first one is the name of the item, and is required. The second item is not required, and is the optional text that will show up when hovered. If not given, the hover text will be the name of the item. The last item is the color of the text. If not given, it will default to the ListTextColor setting.

Displays a notification to the given plr, with the given text, lasting for duration seconds. The title of the notification is set as "title".

Returns true if the given plr is currently a VIP.

Returns true if the player with the given is flagged as abusive.

Returns true if the given plr is currently a donor. This was used for our old donor system, and has now been removed.

Returns true if the given Player is part of the group with the given groupname. Currently, this method supports the following group names:
 * abusive
 * blockedfromcallingae
 * blockedfromfeedback

Attempts to set the plr's admin level to the given level. Returns whether or not it was successful.

Displays a countdown on all players, with the length being Seconds. If greater than 600, it will be cut to 600.

Returns the value of a setting, if it exists.

Prompts the targetted player to teleport to the place with the given ID.

Adds a new action to TM-A's action log, with the name of the player being plrName and action being the given player and action. This method will error if the "AllowCustomActionLogs" setting is off.

Locks a team, preventing everyone except owners and creators from joining it.

Unlocks a previously locked team, allowing Mods+ to join it.

Returns true if the given team is locked, false otherwise.

Returns an array of teams that are currently locked.

Clears a log. logName must be 'ActionLog', 'AdminLog', or 'ChatLog', otherwise this method will error with a "Specified log not found".

Changes the required level of an admin command. Level must be 0 (Player), 2 (Moderator), 3 (Administrator), 4 (Super Administrator), 5 (Owner), or 6 (Creator). This command will error if you attempt to set a VIP command's level. This command will also error if you attempt to set a command to 1 (VIP).

Returns a based on the given color name (found in the colors list). Returns if no color was found.

Prompts the targetted player to view the colors list. This is expected to be used in conjunction with the GetColor method.

Forces the VIP benefits menu to open for the given player.

Will restore the map (:rsm command). If showNotification is false, no notifications will be shown when refreshing the map.

Prompts the given player to purchase the item with the given ID, using TM-A's custom purchase UI.

Returns a copy of TM-A's Dex UI (used with the :dex command).

Returns a copy of TM-A's F3X tool.

Enables the easter egg. This method will only work at the demo place, otherwise it will silently fail.

Events
Access these by using main.events.[NAME]

Fires when the Message method is used, either through the main table or in the core.

The first parameter is a bool describing whether or not the process was successful. The second parameter is the Player being chared. The third parameter is the name of the person who this player was charing to.

Fired when a player is cloned. plr is the player that was cloned, and clone is the new body created.

Fires when the Server Lock status is changed.

Fires when a new waypoint is created.

Fires when an action is added to TM-A's action log. 'type' will either be "Custom" or "Core". If type is "Custom", then the action was made by a developer. If the type is "Core", then the action was made in TM-A's core. playerName is the name of the player associated with the action, and action is the actual action that took place.

Fires when a team is locked.

Fires when a team is unlocked.

Fires when a player clicks on the limited time easter egg. This easter egg only occurs at the demo place, so using this event is essentially useless.

Callbacks
A list of callbacks which you can use to manipulate how TM-A runs. Access these by using main.callbacks.[NAME]

This callback is invoked when admin is about to be given. If the function associated with this callback returns false, admin will not be given.

Services
A list of predefined services. Access these by using main.services.[NAME]

A property referencing to the.

A property referencing to the.

A property referencing to the.

A property referencing to the.

A property referencing to the.

A property referencing to the service.

A property referencing to the.