Making an Ai in roblox

Not quite what i wanted but it has some things i would use tho

the add a script in it and this in this script:

function onChatted(msg, recipient, speaker)
local noob = script.Parent.Parent
local brain = noob.Brain
local max = 50
local num = 0
local c = string.len(msg)
if c > max then
return
end
local incriment = 1.25
noob.Head.Mesh.Scale = noob.Head.Mesh.Scale*incriment
wait(0.1)
noob.Head.Mesh.Scale = Vector3.new(1.25,1.25,1.25)

local b = brain:GetChildren()
for i=1,#b do
if b[i].Name == msg then
return
end
end
for i=1,#b do
if b[i].Value > num then
num = b[i].Value
end
end
num = num + 1
local new = Instance.new(“NumberValue”)
new.Name = msg
new.Value = num
new.Parent = brain
end

function onPlayerEntered(newPlayer)
newPlayer.Chatted:connect(function(msg, recipient) onChatted(msg, recipient, newPlayer) end)
end
game.Players.ChildAdded:connect(onPlayerEntered)

1 Like

yea but it will print the stuff the player says and it learns from that

1 Like

and this is how the character should look like

1 Like

mhm ill probably make a script that searches for key words (words that are typically beside conjunctions such as: as, the and but ,and save them until it gets the context of them).

robloxapp-20210809-1552485.wmv (1.2 MB)

1 Like

here is a video of the ai learning

1 Like