I'm trying to create a party system, and users are able to name their own party for other players to see. I would need to filter the name string if I don't want actions to be taken against me. I tried filtering the string, but it seems if I print the name of the party, it is not filtered. Is there anything wrong?
--Filter's the party name. function module:filter(name, from) local filtered local success, errormessage = pcall(function() filtered = TS:FilterStringAsync(name, from.UserId) end) if success then filtered = filtered:GetNonChatStringForBroadcastAsync() return filtered else warn(from.Name.."'s party name does not pass ROBLOX's filter.") WarningRemote:FireClient(from, "Warning", "PARTY NAME DEFAULTED") --Use default party name if filter failed. return "LET'S PLAY" end end --Create new party with specified requirements and size. function module:new(creator, name, requirement, size) if not creator then return end --Set default values for party if arguments are not given. if name then name = string.upper(module:filter(name, creator)) else name = "LET'S PLAY" end requirement = requirement or 1 --Party size defaulted to 4 if not specified or a maximum of 6 people if size then size = math.min(math.max(1,size), 6) else size = 4 end module.inParty[creator.Name] = true local group = {} group.identifier = helper:getidentifier() group.leader = creator.Name group.name = name group.requirement = requirement group.banned = {} group.members = {[creator.Name] = true} return group end
This is how I check the party's name and number of parties. All parties are put in a dictionary with a unique identifier.
while wait(2) do local length = {} for _, party in pairs(parties) do if party ~= nil then print(party.name) table.insert(length, party) end end print(#length.." parties created.") end
Locked by JesseSong
This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.
Why was this question closed?