@name FailCake Secret Language Convertor V3
@persist [O E Target]:entity Convert [Say2 Say Said]:string Max Reset I I2
@persist [SayOC SayO SayT]:array [Language Invert]:table Translate
@trigger all
@model models/props_lab/binderredlabel.mdl
  # Made By FailCake :D 
runOnTick(1)
runOnChat(1)

# REQUIRES wire_expression2_concmd 1
# Made By FailCake :D

if(first() | duped()){
E = entity()
O = owner()
Say = ""
Max = 0
Convert = 0
Reset = 0
Translate = 0
Said = ""
Say2 = ""
I = 0
I2 = 0

Language["a",string] = "i"
Language["b",string] = "u"
Language["c",string] = "j"
Language["d",string] = "z"
Language["e",string] = "q"
Language["f",string] = "o"
Language["g",string] = "w"
Language["h",string] = "x"
Language["i",string] = "k"
Language["j",string] = "n"
Language["k",string] = "e"
Language["l",string] = "d"
Language["m",string] = "b"
Language["n",string] = "v"
Language["o",string] = "l"
Language["p",string] = "y"
Language["q",string] = "h"
Language["r",string] = "c"
Language["s",string] = "g"
Language["t",string] = "a"
Language["u",string] = "t"
Language["v",string] = "r"
Language["w",string] = "s"
Language["x",string] = "p"
Language["y",string] = "m"
Language["z",string] = "f"
Language[" ",string] = " "

Language[".",string] = "+"
Language[",",string] = "="
Language["?",string] = "&"
Language[":",string] = "/"
Language["'",string] = "+"

Language["-",string] = ">"
Language["_",string] = "^"
Language[";",string] = "*"

Language["1",string] = "5"
Language["2",string] = "7"
Language["3",string] = "0"
Language["4",string] = "1"
Language["5",string] = "4"
Language["6",string] = "6"
Language["7",string] = "2"
Language["8",string] = "3"
Language["9",string] = "8"
Language["0",string] = "9"
# Made By FailCake :D
Language["!",string] = "<"
Invert = invert(Language)

setName("FailCake Secret Language Convertor V3 ["+O:name()+"]")
}

if(Convert == 0 & Translate == 0){ 
if(Target != noentity()){    
    
if(chatClk(Target)){   
SayT = Target:lastSaid():explode("")    

if(SayT[1,string] == "$"){
Translate = 1
Said = Target:lastSaid():lower()
Max = Said:length()    
}
    
}

}  
    
    
    
if(chatClk(O)){
SayOC = O:lastSaid():explode(" ")
SayO = O:lastSaid():explode("")
if(SayOC[1,string] == "!set"){
hideChat(1)
if(findPlayerByName(SayOC[2,string]):isPlayer()){
Target = findPlayerByName(SayOC[2,string])
print("Chat Target Set!")
print("Target = " + Target:name())

setName("FailCake Secret Language Convertor V2 ["+O:name()+"]["+Target:name()+"]")
}else{
hint("Player Not Found!",7)
}    
   # Made By FailCake :D 
}else{
if(SayO[1,string] == "#"){
Convert = 1
Say = "$"
Said = O:lastSaid():lower()
Max = Said:length()
hideChat(1)
}
}    
}



}



## - Convert It - ##

if(Convert == 1){ 
for(I=1,Max){
Say += Language[Said[I],string]  
if(I == Max) {Convert = 2} 
}
}
   
if(Convert == 2){
timer("wait",600)
timer("hold2",800)

if(clk("wait")){
concmd("say "+Say) 
print("Converted!")
E:setColor(255,155,0)
hint(Say,7)   
}

if(clk("hold2")){
Convert = 0    
Reset = 1
}
   
}  # Made By FailCake :D 
# Made By FailCake :D
## - Translate It - 

if(Translate == 1){     
for(I2=1,Max){    
Say2 += Invert[Said[I2],string] 
E:setColor(255,155,0)
if(I2 == Max) {Translate = 2} 
}
}

if(Translate == 2){
print(Target:name() + ": "+Say2)    
Reset = 1
}

# Made By FailCake :D
if(Reset){
Say = ""
Say2 = ""
Max = 0
E:setColor(255,255,255)
I = 0
I2 = 0
Convert = 0
Reset = 0
Translate = 0
Said = ""
Reset = 0
}

  # Made By FailCake :D 

