LordDragonZord's approach solves the problem indirectly by not allowing there to be more than one Message at a time.
The actual problem here is that your msg variable is being over-written each time this function runs. To fix this, simply make the variable local:
function RemindLosers(person)
local msg = Instance.new ("Message", workspace)
msg.Text = "Don't forget to thumbs up! I'm talking to you, " .. person.Name
wait(3)
msg:Destroy()
end
script.Parent.ClickDetector.MouseClick:connect(RemindLosers)
What this does is creates a new msg variable for every time the function is called - they will never overlap. This is called declaring the scope of the the variable. It will not be accessible outside of the function, and multiple function calls will have their own, unique version of it, even though the same code is running.
3 comments
adark, this script u made was worse than mine. The messages it creates have no text!
What's wrong with :remove()? I know :Destroy() is better and most people use it, but what if you need it again later? :remove() changes the parent of an object to nil so I could retrieve it later if I wanted to, and it's shorter than writing "script.Parent = nil".
That's true, but in this case it's unneccesary, and storing stuff in
nilis bad practive regardless. Garbage collection exists. @groovy; I don't know why you're not getting any text with this one, I just tested it and it works fine for me.