Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Trying to filter a character description?

I really don't understand this Text Filtering stuff, being new to Lua. So, I wrote this script where you do the "/describe" command, and it puts a description of your character on you. I have everything working, but when I try to filter it, it runs like normal, and isn't filtered. What did I do wrong?

function onChatted(message, player)
	local filteredText = game.Chat:FilterStringForBroadcast(message,player)
    if filteredText:sub(1,10) == "/describe " then
		local description = filteredText:sub(11),player
		local character = game.Workspace[player.Name]
		if character:findFirstChild("Description") == nil then
			game.ServerStorage.Description:Clone().Parent = character.Torso			
		end
		local GUI = character.Torso.Description
		GUI.Frame.Display.Text = player.Name .. " " .. description
    end
end
 
game.Players.PlayerAdded:connect(function(player)
    player.Chatted:connect(function(message) onChatted(message, player) end)
end)

--Gitrog's /describe script

1 answer

✓ Accepted answer
 local description = filteredText:sub(11),player

That's wrong. Remove ',player'

Then try it.

1 comment

0

Thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.