Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local BadWords = {"bitch"}
- local Warnings = {}
- local Gold = 10000
- Swear = {}
- function Swear.find(event, player, message, type, language)
- local s = {}
- message:gsub("(%w+)", function(c) table.insert(s,c) end)
- for i = 1, #s do
- if not (table.find(BadWords, s[i])) then
- else
- if(Warnings[player:GetName()] == nil) then
- Warnings[player:GetName()] = 1
- elseif(Warnings[player:GetName()] == 2) then
- if(player:GetCoinage() >= 1000*Gold) then
- player:DealGoldCost(1000*Gold)
- else
- if(player:GetLevel() >= 2) then
- player:SetLevel(player:GetLevel()-1)
- else
- player:KickPlayer(0)
- end
- end
- Warnings[player:GetName()] = nil
- else
- Warnings[player:GetName()] = Warnings[player:GetName()] + 1
- end
- return 0
- end
- end
- end
- RegisterServerHook(16, "Swear.find")
- function table.find(t, v)
- if type(t) == "table" and v then
- for k, val in pairs(t) do
- if v == val then
- return true
- end
- end
- end
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement