Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago

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

0
First: Put some spaces in the for loop. Second: change the dot ( . ) beetween `_` and the `v` in the for loop to a `,` (comma) cailir 284 — 4y

1 answer

Log in to vote
1
Answered by 4 years ago

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!

0
Wow! I haven't noticied this error... (and you wrote faster than me...) cailir 284 — 4y
0
And to optimize the code you can put an Random thing to say with the wait(interval) on the while loop... cailir 284 — 4y
0
Yes, but I wanted to write the same script as he wrote and just change the errors TheRealPotatoChips 793 — 4y
Ad

Answer this question