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

i made a message script and it said text is not a valid member of Message, can someone help?

Iam using the Roblox book on how to script and copied it exactly, but it is not working for some reason. If someone can tell me at least what exactly is wrong with this please tell me. here is the script:

local Message = Instance.new("Message") -- Defines a new instance of a message for the entire script

Message.text = "Hello World" -- Sets text of the message Message.Parent = game.Workspace -- Our message is now inside the Workspace

wait(5) -- Waits 5 seconds

Message:Remove () -- Removes our message

2 comments

0

Lua is case sensitive: the problem is that you said "msg.text," when, with lua, you require to have the property match the actual property, which is "msg.Text." Plz do some research next time. Thanx. c;

0

What he said...

2 answers

Lua is case-sensitive.

Message.text is not a valid property of a Message Instance. Message.Text on the other hand, is.

Message.text = "Hello World"

Replace that with

Message.Text = "Hello World"

1 comment

0

Well, the code has to match up with the property exactly, otherwise it wont work. ;P

Just adding on to what they're saying; you need to use

Message.Text

instead of

Message.text

1 comment

0

Yeah, why is this voted down?

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