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

Message should be removed, but it isn't?

(Last question of the day!)

I have an error here that means that the message isn't removed. Anyone know why?

function message(text,time) --Message Function
    local msg = Instance.new("Message",workspace)
    msg.Text = text
    game:GetService("Debris"):AddItem(Message, time)--Same thing
end

This code works with hints, but not messages. Anyone see why?

message("THE RACE HAS BEGUN!!!!!", 3)

This is how the function is referenced in later parts of the script.

1 answer

✓ Accepted answer

Your error is on line 4.

The AddItem method of Debris takes an object reference and, optionally, a time.

You're trying to pass in Message, which is an undefined variable. You should instead pass in msg:

game:GetService("Debris"):AddItem(msg, time)

1 comment

0

Fair enough! Thanks for that.

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