I want this Ai to spawn a zombie when it says something
code:
chats = {“how do i play this game”,“nub”,“help plz”,“im gonna spawn in a zombie”}
game.Players.PlayerAdded:Connect(function(player)
wait(3)
game:GetService(“Chat”):Chat(script.Parent.Head, "hi "…player.Name, Enum.ChatColor.Green)
end)
while true do
wait(6)
game:GetService(“Chat”):Chat(script.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Green)
end
Try this. Just put your zombie model inside ReplicatedStorage, and put this server script in ServerScriptService.
chats = {"how do i play this game","nub","help plz","im gonna spawn in a zombie"}
game.Players.PlayerAdded:Connect(function(player)
wait(3)
game:GetService("Chat"):Chat(script.Parent.Head, "hi "..player.Name, Enum.ChatColor.Green)
end)
while wait(6) do
game:GetService("Chat"):Chat(script.Parent.Head, chats[math.random(1, #chats)], Enum.ChatColor.Green)
local zombie = game:GetService("ReplicatedStorage").Zombie
zombie.Parent = game.Workspace
end