script in serverscriptstorage
local part = game.Workspace.Part
local whoClicked = game:GetService("ReplicatedStorage").whoClicked
part.ClickDetector.MouseClick:Connect(function(playerWhoClicked)
whoClicked:FireAllClients(playerWhoClicked)
end)
local script in screengui
local whoClicked = game:GetService("ReplicatedStorage").whoClicked
whoClicked.OnClientEvent:Connect(function(playerWhoClicked)
game:GetService("Players").LocalPlayer.PlayerGui.ScreenGui.TextLabel.Text = playerWhoClicked
end)

1 comment
playerWhoClicked.Name