Hi! I’m PinkScripts, a programmer. I was creating a script earlier and I encountered an error while trying to get my NPCs to chat. It is extremely weird because It worked for the first 3 NPCs, but the following NPCs came up with an error. I duplicated the NPCs and all I changed was the string, which changes the text of what the NPC says.
My script:
local chat = game:GetService("Chat")
local head = script.Parent.Head
while true do
chat:Chat(head, "Hello, I am Aesterza!", "White")
wait(5)
chat:Chat(head, "I am the Vice-President of Embassy Resorts!", "White")
wait(5)
chat:Chat(head, "Do check out our Cafe! We have delicious donuts!", "White")
wait(5)
chat:Chat(head, "Do leave a like on the game!", "White")
wait(5)
end
My error:
All my NPCs, including the ones in which the Chat Scripts have no errors, are placed under a folder under the workspace. Please let me know if you know is a solution to this! Thank you!
Your script may not work because you are referring to ‘head’ which isn’t under Workspace, but the character you can refer to too. Try to replace ‘head’ with the NPC model:
local head = script.Parent.Head >>> local npc = script.Parent
I don’t know then, sorry. All you can do is restarting Roblox studio, if this doesn’t help then restarting your PC and if even this doesn’t help then just reinstall Roblox Studio. If any of this doesn’t work and it isn’t showing any errors, then contact Roblox support through here Support - Roblox (It may take a while until they get to solving your report).