|
| 26 Jan 2016 06:37 PM |
| I'm allowing the Player to set a RolePlay name, and I want to check this TextBox for words I restrict to be within the Name, I've searched up filterstringforplayer but I'm not really understand it. Could someone expand on the Topic? |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2016 06:38 PM |
| local rolePlayName = game:GetService("Chat"):FilterStringForPlayerAsync(PLAYER, TEXTBOX.Text); |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Jan 2016 06:41 PM |
Actually, this might be better:
--define player, textbox local chat = game:GetService("Chat")
local rolePlayName; repeat rolePlayName = textbox.Text until rolePlayName == chat:FilterStringForPlayerAsync(player, rolePlayName)
That should keep asking for it until they write an appropriate name. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2016 06:42 PM |
game:GetService("Chat") finds game.Chat :FilterStringForPlayerAsync(PLAYER, TEXTBOX.Text) calls the method FilterString..., passing in the player and the text and returning a scrubbed string. |
|
|
| Report Abuse |
|
|
|
| 26 Jan 2016 06:47 PM |
I'd like it to display a warning that I have made,
would this work?
local rolePlayName = script.Parent.Parent["Roleplay Name"].TextBox.Text if rolePlayName ~= chat:FilterStringForPlayerAsync(plr, rolePlayName) then -- Display Alert end
Sorry if its completely off. |
|
|
| Report Abuse |
|
|
| |
|