Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

ok so i need a talking part script can anyone help? (i know no lua)

ok SO i need a script that can make a part talk i have this so far

local thingstosay = {"Feed me","The Hunger..","Obey"}
local interval = 10
local colour = "red"

while wait()do
	for_.v in pairs(thingstosay)do
		game:GetService("Chat"):Chat(script.Parent, v, colour)
		wait(interval)
	end
end

and it doesnt work, can anyone help? help is appreciated! thanks for reading and have a nice day :D

1 comment

0

First: Put some spaces in the for loop. Second: change the dot ( . ) beetween _ and the v in the for loop to a , (comma)

1 answer

✓ Accepted answer

Hi. The problem is that at line 3, where you made a variable of a color, it has to be the real name of the color. So the color "red" takes a capital letter:

local thingstosay = {"Feed me","The Hunger..","Obey"}
local interval = 10 -- this is the time you need to wait before letting the part say another thing
local colour = "Red" -- takes a capital letter
	 
while wait()do
	for_,v in pairs(thingstosay) do
		game:GetService("Chat"):Chat(script.Parent, v, colour)
	        wait(interval)
	end
end

Hope this helped!

3 comments

0

Wow! I haven't noticied this error... (and you wrote faster than me...)

0

And to optimize the code you can put an Random thing to say with the wait(interval) on the while loop...

0

Yes, but I wanted to write the same script as he wrote and just change the errors

This discussion is preserved as it was. New answers, comments, and votes are closed.