So i want to create a button , so a part with a button that when u press it a gui appear for the person who cliked on the button ...
I dont know how to do that so if u knwow answer me thx :p
There are two ways of detecting GUI clicks , those use MouseButton1Click and Activated, which is preferred.
The activated event is an event of image/text buttons that fires which a gui is clicked by the lmb and has a input object parameter.
local button = script.Parent button.Activated:Connect(function(io) print("clicked") end)
However, if you are using another mouse button such as the middle mouse button or the right mouse button, you would have to use MouseButton2Click and MouseButton3Click for rmb and mmb respectively.
local button = script.Parent button.MouseButton2Clicked:Connect(function() print("clicked by rmb") end) button.MouseButton3Clicked:Connect(function() print("clicked by mmb") end)
However, if you don't want to have a gui button, you could just put a click detector in a part that you want to act as a button.
The click detector object has a MouseClick function with a playerWhoClicked parameter, so you can easily tell who clicked it.
local cd = script.Parent.ClickDetector cs.MouseClick:Connect(function(plr) print(plr.Name.." clicked the button") end)
Hopefully this helped, be sure to accept if it did!