Ok even if I knew how to get player who clicked a textbutton from a normal script, i wouldnt know how to use that name to show it on all clients. Is there a way to carry a value (like a player name) to another script? (Specifically server to local all clients) I need help with these 2 things?
script.Parent.MouseButton1Click:Connect(function(player)
print(player.Name)
end)
Would this work? Also if it does how do i carry that player.Name value to a local script for all clients after firing a remote event? I would appreciate some help because im stumped
Ok, MouseButton1Down doesn't return any values, so the player parameter in your script is nil. Before you ask why, I don't know why; I think it is stupid.
To fix the script would need to find how many parents the script has until you reach the screengui. (Example: script > textbutton > frame > screengui = 3) Then, in your script you would add 2 more parents. All gui's go into PlayerGui, which is sent into the player object. Your script would look like this:
script.Parent.MouseButton1Click:Connect(function() print(script.Parent.Parent.Parent.Parent.Parent.Name) --Using the same example above end)
(Just a bit of a sidenote: when asking questions here, be sure to use the "Code Block" button and not the "Inline code" when writing Lua Scripts)
I hope this answers your question.