Hello, I just made a quick script. It is 5 lines long. It is just that I don't know how to use this script what I made!
If I remove the Player.. and "Clicked the button" it works fine. But I want it to print the Player Clicked the button! Help? Thanks.
The script is
function onClick(Player) print(Player.. "Clicked the button!") end script.Parent.ClickDetector.MouseClick:connect(onClick)
And the error is
11:39:21.066 - Workspace.Part.Script:2: attempt to concatenate local 'Player' (a userdata value) 11:39:21.067 - Stack Begin 11:39:21.067 - Script 'Workspace.Part.Script', Line 2 11:39:21.068 - Stack End
function onClick(Player) print(Player.Name.. " Clicked the button!") -- You need to use the players' name (as M39a9am3R said), you used the actual player. end script.Parent.ClickDetector.MouseClick:connect(onClick)