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

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

Asked by 7 years ago

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

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; TheeDeathCaster 2368 — 7y
0
What he said... iRoklas 1 — 7y

2 answers

Log in to vote
3
Answered by 7 years ago

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"
0
Well, the code has to match up with the property exactly, otherwise it wont work. ;P TheeDeathCaster 2368 — 7y
Ad
Log in to vote
-1
Answered by 7 years ago

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

Message.Text

instead of

Message.text
0
Yeah, why is this voted down? LordOfLuxury 84 — 7y

Answer this question