I've been trying a while now with a doorbell-like device. it has a ClickDetector and Script inside it and it's supposed to say something like "(playername) has rung your doorbell!". I can't figure out how to get the player's name! And it's driving me nuts. Please help me out ASAP!
Thanks...
Parameter is a very clever way of identifying what actually triggered your events. Here's a example.
script.Parent.ClickDetector.MouseClick:connect(function(Click)--The Parameter can be given any string name you desire e.g "Click" print(Click)--This will print out the name of the Player that triggered the touch event end)
~ UserOnly16Characters Hoped I helped you to answer your question! If you have any further question, don't hesitate to comment below!!
Edited:
script.Parent.ClickDetector.MouseClick:connect(function(Click) local Message = Instance.new("Hint",game.Workspace) Message.Text = Click.Name.." Has clicked this button" wait(3) Message:Destroy() end)