bpm91
Intermediate OT User
- Joined
- May 23, 2019
- Messages
- 931
- Solutions
- 7
- Reaction score
- 128
- Location
- Brazil
- YouTube
- caruniawikibr
hey guys, I would like to know if anyone would know what a function would be like to block some non-standard names in the game, as I would like the player not to make some non-standard names
here is a change name from my Store to my otc
tfs 1.5 OTV8
I would like to block names that use
1 symbols, except ' and -
there used to be names like Ot'land or Ot-land
then the ' could be freed. but symbols like !@#$%¨&¨&()_+={}{^~;.,><;:-+
2 the use of 2 capital letters together,
Initial with lowercase.
Repetition of letters like AAAAA.
well I don't know how a script of this level would be, I believe that on a website it would be easier. however, the system has already been added to the client
here is a change name from my Store to my otc
tfs 1.5 OTV8
I would like to block names that use
1 symbols, except ' and -
there used to be names like Ot'land or Ot-land
then the ' could be freed. but symbols like !@#$%¨&¨&()_+={}{^~;.,><;:-+
2 the use of 2 capital letters together,
Initial with lowercase.
Repetition of letters like AAAAA.
well I don't know how a script of this level would be, I believe that on a website it would be easier. however, the system has already been added to the client
Lua:
function purchase()
if not selectedOffer then
displayInfoBox("Error", "Something went wrong, make sure to select category and offer.")
return
end
hide()
if string.find(selectedOffer.title, "Name") and string.find(selectedOffer.title, "Change") and modules.client_textedit then
modules.client_textedit.singlelineEditor("Choose New Name", function(newName)
selectedOffer.newName = newName
if GetNumbers(newName) then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
if string.len(newName) == 0 or string.len(newName) > 26 or string.len(newName) < 3 then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
if string.find(newName:lower(), "account") or string.find(newName:lower(), "tutor") then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
if string.find(newName:lower(), "admin") or string.find(newName:lower(), "god") or string.find(newName:lower(), "adm") then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
if string.find(newName:lower(), "gm") or string.find(newName:lower(), "cm") or string.find(newName:lower(), "gamemaster") then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
if string.find(newName:lower(), "ç") or string.find(newName:lower(), "manager") then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
if string.find(newName:lower(), "@") or string.find(newName:lower(), "yes") then
displayInfoBox("Error", "The name you choosed isn't allowed.")
buyCanceled()
return
end
local title = "Purchase Confirmation"
local msg = "Do you want to change your name to ".. newName .." for " .. selectedOffer.price .. " points?"
msgWindow =
displayGeneralBox(
title,
msg,
{
{text = "Yes", callback = buyConfirmed},
{text = "No", callback = buyCanceled},
anchor = AnchorHorizontalCenter
},
buyConfirmed,
buyCanceled
)
end)
else
local title = "Purchase Confirmation"
local msg = "Do you want to buy " .. selectedOffer.title .. " for " .. selectedOffer.price .. " points?"
msgWindow =
displayGeneralBox(
title,
msg,
{
{text = "Yes", callback = buyConfirmed},
{text = "No", callback = buyCanceled},
anchor = AnchorHorizontalCenter
},
buyConfirmed,
buyCanceled
)
end
end