Example: when i type "hi" in the chat, the NPC will start walking to me.
Scripting Helpers is not a request site! (But I’ll give you the part that detects if you say “hi” in chat)
local PlayersService = game:GetService("Players") local StringToDetect = "hi" PlayersService.PlayerAdded:Connect(function(Player) Player.Chatted:Connect(function(Message) if string.find(string.lower(Message), string.lower(StringToDetect)) then if Player.Character then -- code end end end) end)
local str = "Hi" local npc_character = PATH.TO.YOUR.NPC game:GetService("Players").PlayerAdded:Connect(function(player) player.CharacterAppearanceLoaded:Wait() local char = player.Character player.Chatted:Connect(function(msg) if string.find( string.lower(msg), string.lower(str) ) then local npc_hum = npc_character:FindFirstChildOfClass("Humanoid") if not npc_hum then return end npc_hum:MoveTo(char:GetPrimaryPartCFrame().Position) end end) end)
haven't tested
Scripting Helpers is not a request site it is a website where you ask the community to help debug errors with your code and help other people debug errors with their code.