User:Thundermaker300/ThunderServices

ThunderServices is a feature currently in development, made by Thundermaker300. It features different services that were all made by Thundermaker300.

Want to be notified when new updates come out? Click here.

How to use
To use the system, put the following code into a, , or the Command bar. Note that ThunderServices will NOT work on a.

This returns a ThunderServicesMain object.

Documentation (Services)
There is currently eleven services, each one is different, and inherits one main object.

ThunderServicesMain
This object is what gets services, and gets and sets settings. It has six methods.

Returns a ThunderService with the given name, or nil if the service doesn't exist.

Returns a Settings object.

Returns an of s, each one being the name of a service.

Returns an of s, each one being the name of a service that requires 's HttpEnabled property to be enabled.

If one of these services is required but HttpEnabled is false, will be returned rather than the service.

Opposite function of GetHTTPServices. Returns an of services that do not need HttpEnabled property to be on.

Some services rely on others to work properly. Returns an of arrays. Each array has two items.

Settings
This object is used to get and set settings. It has two methods.

Returns the value of the given setting.

Sets the setting with the given name.

Example Usage of Settings
In this example, we will set the SponsorTime to 5. The correct usage is below.

All Settings
The following settings can be changed by a Settings object.


 * IncognitoDiscordWebhooks: If set to true, A message will not be printed when a webhook is sent to discord. Default is 'false'.
 * PictureForm: Determines how the PictureService returns messages. Value must be 'content' or 'id', or PictureService will not work correctly.  If value is 'content', then a  will be returned, while if the value is 'id', then an  will be returned.  Default is 'content'.
 * SponsorTime: Determines how long sponsors sent by the SponsorService will last. The value must be '5', '10', or '15', or the script will error.  Default is 10.
 * MuteSponsorWarnings: If set to true, there is no warning when SponsorService cannot display an error when the given player follows one of the no-sponsor criteria. Default is false.

ThunderService
ThunderService is an object that each service inherits from. It currently has two methods.

Returns a string that explains information about the service.

Returns whether or not the given service is or inherits the given object. Every service inherits only ThunderService. Works similar to the method of the  class.

Color3Service
Color3Service is an extension of the Color3 data type. It has sixteen methods.

Returns a Random Color3.

Returns Dark Red.

Returns Really Red.

Returns Navy Blue.

Returns Really Blue.

Returns Teal.

Returns New Yeller.

Returns Bright yellow.

Returns Deep Orange.

Returns Gold.

Returns Lime Green.

Returns Bright green.

Returns White.

Returns Black.

Returns Gray.

Returns Brown.

ExtraLightingService
ExtraLightingService is an extension of the service. It has one method.

Causes a grayscale effect, that is defaultly disabled. Returns two functions. The first requires a bool argument, and it will enable/disable the grayscale. The second function requires no arguments, and when called, will destroy the grayscale. Grayscale cannot be used when destroyed.

DiscordWebhookService
NOTE: If HttpEnabled is set to false, getting this service will return.

DiscordWebhookService is a service that allows easily sending webhooks to discord. It has one method.

Creates a WebhookObject with the given id and key, and returns it.

ThunderNewsService
ThunderNewsService is a service that can be used with ThunderNews. It has one method.

Loads ThunderNews and returns a.

NPCService
NPCService is a service used for easily handling NPCs. It has one method.

Creates a blank NPC, and returns an NPCObject object.

PlayersService
PlayersService is an expansion of the service. It has two methods.

Attempts to find the player with the name of "name". This function will also find players if the name is a prefix of the user's name. Eg. if there is a player named "Shedletsky", and "Shed" is set as the name parameter, it will return Shedletsky's. However, if there is a player named "Shed" present, it will return that player instead of Shedletsky. This function will return if:
 * There are multiple people with this prefix.
 * There are no people with this prefix.

Returns the first player with the membership of MembershipType, or if none is found.

MathService
MathService is a service designed to add more functions than the math includes. It has one method.

Attempts to invert the given, returning the opposite of it. For example, if 10 is given, -10 will be returned. Note: will be returned if the input is 0 or math.huge.

PictureService
PictureService is a service that returns different pictures. It has one method.

Returns a random kitten picture. It will return either a or  based on the 'PictureForm' setting. It will return if 'PictureForm' is not 'content' or 'id'.

TimeService
''' TimeService is no longer being updated. It is not recommended to be used.''' TimeService is a serviced used for managing time. It has five methods.

Returns the given hour and period as military time. 'period' must be 'am' or 'pm'.

Returns the given hour as 12-hour time. Returns an, the hour, and a , am or pm.

Returns the current hour, minute, and second of time in Eastern Standard Time. It is returned as military time.

NOTE: This service uses MathService.

Returns the current hour, minute, and second of time in Central Standard Time. It is returned as military time.

NOTE: This service uses MathService.

Returns the current hour, minute, and second of time in Mountain Standard Time. It is returned as military time.

SponsorService
SponsorService is a service that functions similar to, but has pictures instead of videos. Due to ROBLOX limitations, ROBUX cannot be awarded to the developer for playing a sponsor, but rather to make features for the players.

SponsorService will not show a sponsor when :PlaySponsor is called if the player owns the "No Sponsors" gamepass.

SponsorService has five methods and two events.

NOTICE: Unlike, SponsorService does not limit on the amount of sponsors that can be seen. Because of this, if you make a "watch a sponsor for x" feature, you need to make limits on your own, or players can nerf the system.

Plays a sponsor on the given player. The sponsor will not play if the given player is already seeing a sponsor. The time the sponsor lasts is based on the SponsorTime setting. Returns two values. The first is a, describing whether or not a sponsor was shown. The second is the id of the sponsor that was shown. The second value will be if the first value is false.

Returns an of players who are currently seeing sponsors. Returns if no players are seeing sponsors.

Returns true if the given player is seeing a sponsor. False otherwise.

Yields the script until no players are seeing a sponsor.

Yields the script until the given player is not seeing a sponsor.

Fires when a sponsor is beginning to show.

Fires when a sponsor has finished.

StrawpollService
NOTE: If HttpEnabled is set to false, getting this service will return.

StrawpollService is a service used for managing strawpolls, created on strawpoll.me. It has two methods.

Returns a strawpoll object with the given strawpoll id.

Creates a strawpoll with the given title, and options. captcha is a bool describing whether or not captcha is required to vote on the poll. Returns an int, which is the id, and a strawpoll object. This method will return 1 nil if the option is not an or there is 1 or less items in the array.

QuoteService
QuoteService is a service used to easily get quotes. It has one method.

Returns a Quote object based on the given category. If no category is given, then funny is default. The following categories are acceptable:
 * Funny

TranslateService
NOTE: If HttpEnabled is set to false, getting this service will return.

TranslateService is a service used to easily get different translations. TranslateService uses Yandex Translation API. It has two methods.

Returns the language code based on the given language (for example, "Spanish" returns es). Not all are supported and an alert will be given if a parameter not supported is given.

Returns the given text in the given language code. If successful, returns two strings. The first string is the translation that was made. Format is. For example, if converting from English to Spanish, this would be. The second string is the actual translation. For example, if text is "Hello" and languageCode is "es", then "Hola" would be returned as this string.

Documentation (Objects)
Objects are returned from services, that cannot be created. There is currently three objects.

WebhookObject
A WebhookObject is an object that represents a Discord webhook. It is created by the DiscordWebhookService. It has one method.

Sends the webhook to discord. configs is a allowing you to configure the webhook's content. There is two settings currently:

NPCObject
An NPCObject is an object that represents a NPC. It has three methods.

Destroys the NPC's current shirt and puts on the shirt with the given id.

Destroys the NPC's current pants and puts on the pants with the given id.

Returns a that is the NPC that was created when :CreateNPC was called.

Strawpoll
A Strawpoll is an object that represents a strawpoll created on strawpoll.me. It has two methods.

Returns the title of the strawpoll.

Returns an array of arrays. In each array, there is two elements.

Quote
Quote is an object that represents a quote, returned from QuoteService. It has two methods.

Returns the actual quote associated with this quote.

Returns the author of this quote. Usually it is formatted as "-[Author]", but you can do this however you want.