Im creating a script for this… here is the part of it that is working
wait(2)
local builtin = {"script","workspace","game","gcinfo","getmetatable","newproxy","pairs","next","string","table","debug","wait","setmetatable","setfenv","getfenv","require","unpack"}
local keyword = {"if","for","else","continue","break","do","local","self","return","repeat","function","nil"}
local function GetLineSelected(s)
local text = s.Text
local p = s.CursorPosition
local text2 = ""
for i = p,1,-1 do
local c = text:sub(i,i)
if c == "\n" then
break
else
text2 = text2 .. c
end
end
return (text2:reverse()),#text:sub(1,p):split("\n")
end
local function GetCurrentLine(text)
local Line,LineNumber= GetLineSelected(text)
return LineNumber,Line
end
local StopandgetWord=function(s)
local text = s.Text
local p = s.CursorPosition-1
local text2 = ""
for i = p,1,-1 do
local c = text:sub(i,i)
if c:find("%p") or c:find("%s") then
break
else
text2 = text2 .. c
end
end
return (text2:reverse())
end
local match=function(text)
local add={}
for _,v in pairs(builtin) do
if v:sub(1,#text)==text ~=nil then
if #text~=2 then
add[v]=true else continue
end
end
end
return add
end
local function geti(t,name)
for i,v in pairs(t) do
if i==name then
return i
end
end
end
local function MashTables(t,t2)
local tab = {}
for i,v in pairs(t) do
if type(i) == "number" then
table.insert(tab,v)
elseif type(i) == "string" then
tab[i] = v
end
end
for i,v in pairs(t2) do
if type(i) == "number" then
table.insert(tab,v)
elseif type(i) == "string" then
tab[i] = v
end
end
return tab
end
local a=game.StarterGui.ScreenGui.TextBox
spawn(function()
a:GetPropertyChangedSignal("Text"):Connect(function()
local word=StopandgetWord(a)
local input = word
local values = MashTables(keyword,builtin)
local autofills = {}
for k,v in pairs(values) do
pcall(function()
if v:sub(1,#input) == input and input:find("%a") then
table.insert(autofills, v)
end
end)
end
a.TextButton.Text=autofills[1] or ""
if autofills[1]==nil then
a.TextButton.Visible=false
else
a.TextButton.Visible=true
end
end)
end)
spawn(function()
while wait() do
local linen,line=GetCurrentLine (a)
local position = UDim2.fromOffset(#line,(linen*a.TextSize))
a.TextButton.Position=position
end
end)
local UIS=game:GetService("UserInputService")
a.Changed:Connect(function(i)
if UIS:IsKeyDown(Enum.KeyCode.V) == true and (UIS:IsKeyDown(Enum.KeyCode.RightControl)) then
a.TextButton.Visible=false
end
end)
I know my coding is bad but with majdTRM’s example I was able to create this