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 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. caster is the person who sent the message.

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.

Returns true if the given plr is currently a VIP.

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

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.

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.

Services
idk why I made these but here they are. Access these by using main.events.[NAME]

TeleportService
Not the real teleport service. Rather our own custom teleport service which prompts the user to teleport before they actually teleport.