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

It says method 'destroy' a nil value? [closed]

Asked by 9 years ago
Message.Text="Survive the killer, follow the defender of the innocents."
wait(5)
Message.Text:destroy()

Why?

1
Message.Text is a string value. You need to call Instance::Destroy on the message object directly. User#11893 186 — 9y

Locked by adark and AmericanStripes

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

2 answers

Log in to vote
2
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

It's because the Destroy method is not a method of the Text of a Message. You have to use the Destroy method on the Message itself, not the text;

Message.Text="Survive the killer, follow the defender of the innocents."
wait(5)
Message:Destroy() --Is not case sensative, guy below is wrong.

Hope I Helped

+1

0
"The guy below is wrong" our code is exactly the same thing... Tempestatem 884 — 9y
0
You even made it :Destroy() rather than :destroy() Tempestatem 884 — 9y
0
Nah, you were wrong in how you explained why he was wrong. The Destroy method isn't case sensitive; therefore, that's not why he got it wrong; therefore, that's why you were wrong(: Goulstem 8144 — 9y
0
But I still posted the same code, so I got it right :) Tempestatem 884 — 9y
0
Guy below has the same code, except this one has a comment. :P Roboy5857 20 — 9y
Ad
Log in to vote
-2
Answered by 9 years ago

Simply make the D in :Destroy() capital and just remove the message

Sorry I was told it was case sensitive. Too bad I still posted the right code and got -5... >logic

Message.Text="Survive the killer, follow the defender of the innocents."
wait(5)
Message:Destroy()

http://www.roblox.com/Forum/ShowPost.aspx?PostID=122235403

0
You have to make *absolutely* sure your code is correct when you post an answer. If you don't know, look it up or test. Bad answers reflect badly on all of us here, not just you personally. adark 5487 — 9y
0
I know. I just had not realised that :Destroy() was not case sensitive, since most functions are. Tempestatem 884 — 9y