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

Help with tables?

Asked by 10 years ago

I was trying to make a chatlog thing but I got a error saying:

15:32:20.481 - Chatlog = {}

------------------------------

InsertChat = sc:3: attempt to index global 'script' (a nil value)

15:32:20.482 - Stack Begin

15:32:20.482 - Script 'Chatlog = {}

------------------------------

InsertChat = sc', Line 3

15:32:20.482 - Stack End

Why did I get this error and how do I fix it?

Chatlog = {}
------------------------------
InsertChat = script.InsertChat
NumberOfChats = #ChatLog
------------------------------
function InsertChat.OnInvoke(Chat)
     table.insert(Chatlog,#ChatLog,Chat)
end
------------------------------

------------------------------

Answer this question