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

Removing objects doesn't work? [closed]

Asked by 9 years ago

I have tried to remove a message from workspace using:

workspace.Message:remove()

and this:

workspace.Message.destroy()

It works when I play from the studio, but when I click play, the Message just stays. What am I doing wrong?

2
Methods are canonically uppercase, not lowercase (though this is only a warning and not an error). In addition, `Destroy` is a method, not a property, and is also indexed with `:Destroy()` and not `.Destroy()`. BlueTaslem 18071 — 9y
1
You should also make sure that Message actually exists as a child of workspace. Basswobble 165 — 9y
0
@Blue; it is a member, otherwise it couldn't be a method. You just have to invoke it with (:) as a method, or provide the 'self' parameter when calling it as a member adark 5487 — 9y

Locked by TofuBytes, adark, and Shawnyg

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

Why was this question closed?