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

"Unable to cast string to token" error when I try my block chat script?

Asked by 5 years ago

I'm trying to create a script, where, everytime you click a button, the chat bubble pops up. But an error saying "Unable to cast string to token" keeps popping up

local message = {"Required assistance!"}
local Interval = 3
local colour = "Pearl"

function onClickedMessage (mouse)
    for _, v in pairs(message) do
        game:GetService("Chat"):Chat(script.Parent, v, colour)
        wait(Interval)
    end
end

script.Parent.ClickDetector.MouseClick:connect(onClickedMessage)

Any ideas?

0
I don't think Pearl is a chat color. (It isn't, I checked). Use Enum.ChatColor to see the choices(there are only 4 I think) Cooltech90 -3 — 5y

Answer this question