Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Using FilterStringASync on a notification system?

Asked by 8 years ago

I have read the wiki and seen the examples for FilterStringASync, but I dont really understand how I would implement this into some form of a notification system. Im making a GUI admin system, and I am trying to put this on my Notification GUI, but Im not sure how id go about doing that. Could someone explain how you could do this?

This is the method it uses to announce things.

Once a button is pressed, a script gets the text from a textbox, puts that text into a StringValue, and the actual notification GUI itself Detects that it was Changed() and Tweens to the side of your screen, displaying the text.

0
Hallo? Anyone? The_Sink 77 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

Hi! Let's begin, shall we? The FilterStringAsync function is formatted as so:

stirng FilterStringAsync (
    string stringToFilter,
    Player playerFrom,
    Player playerTo
)

which is a method of game:GetService("Chat").

FIRSTLY THOUGH: This method is for things like chat systems, from player to player. To use one player, like yours probably is, use:

string FilterStringForBroadcast (
    string stringToFilter,
    Player playerFrom
)

which is also a method of game:GetService("Chat"). This is what I'll use this for your context, as it seems more relevant to a notification system. Use the other method if this is not the case, in the way that it came from a player.

Now to implement that into your context. I'm going to use the variables "notificationtext" for the text within the notification and "client" for the player (the local player, the player viewing the notification):

notificationtext = game:GetService("Chat"):FilterStringForBroadcast(notificationtext,client)

*Note: This might only work on the server instead of the client, so consider the implementation of RemoteFunctions if this is the case (I might be wrong). *

Ad

Answer this question