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

Table with functions does not work? Is it even posible?

Asked by
Aimarekin 345 Moderation Voter
6 years ago
Edited 6 years ago

Hello. I wanted to make a chat script that chats random things when you press a button, but it doesn't work. There is an error in the :Chat function, where I try to do the function thingy. Help?

local chat = game:GetService("Chat")
local function n1 ()
    return "I am starving."
end
local functions = {
    n1
    }

script.Parent.Activated:Connect (function ()
    chat:Chat(game.Players.LocalPlayer.Character, functions[Random.new:NextInteger(1,            
        #functions)](), Enum.ChatColor.White)
end)

Answer this question