Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- To all of the hotel roleplay developers who are too lazy to make their own anti-capitilzation abuse message system. I've made one for you. If you're smart enough to figure out how to plug this in into chat service, i'll pat you on the back myself because my expectations for hotel roleplay developers are extremely low considering 90% of all hotel roleplay developers are very dumb in the brain. Anyway...
- What even is this script? Like i stated above if you have the brain cells to read from top to bottom, but if you do not.. I'll explain again. This is a smart anti-captilization function designed to stop players from "abusing caps". So that chat moderators can stop taking away the freedom of speech from normal respectful human beings. Chat moderators shouldn't even fucking exist in a roleplay game, i mean for chirst's sake, It's a roleplay game. Like how many brain cells do roleplay game devs and staff lack? If you mute your players in a roleplay game it defeats the purpose of the game overall, and the fact that if you're a hotel roleplay developer and are still reading this, proves my point in how brain cell deficient you people actually are. Anyway, enough of me being rude to disgusting hotel roleplay devs, I just thought I'd make an argument.
- Developers who actually would like to use this, plug the function into your chat service, the place that sends messages through the C# server to get filtered. I'm sure you'll figure it out. If you do manage to find what i'm talking about, look at how the chat service works, and think of ways you can use it to your advantage, you know, like making fun chat commands? (maybe even a gamepass for chat commands?)
- ]]
- function capmessage(mtbs)
- PERCENT_MUTIPLIER_FOR_CAPPED_MESSAGES = 80 --[[ 80 is reccomended, set to 100 if you would like to make all messages lowercased ]] /100
- local countup = 0
- local countup2 = 0
- for i=1,#mtbs do
- if string.sub(mtbs,i,i) == " " then countup = countup + 1 end
- end
- for i=1,#mtbs do
- if string.sub(mtbs,i,i) == string.sub(mtbs,i,i):upper() and string.sub(mtbs,i,i) ~= " " then
- countup2 = countup2 + 1
- elseif string.sub(mtbs,i,i) ~= " " and string.sub(mtbs,i,i) == string.sub(mtbs,i,i):lower() and countup2 - 1 ~= -1 then
- countup2 = countup2 - 1
- end
- end
- heck = PERCENT_MUTIPLIER_FOR_CAPPED_MESSAGES
- heck = 1-heck
- if (countup2 / #mtbs) >= heck and #mtbs > 6 then
- local str = ""
- local aos = 0
- mtbs = mtbs:lower()
- --[[for i=1,#mtbs do
- if string.sub(mtbs,i,i) == " " then
- aos = aos + 1
- while string.sub(mtbs,i+aos,i+aos) == " " do
- aos = aos + 1
- end
- else
- aos = 0
- end
- if i+aos == 1+aos then
- ]]
- end
- return mtbs
- end
- g = capmessage("ANtI CaptiLIZED LETTERS is GOOD...APPARently")
- print(g)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement