Hello I found this script that print the player name that got clicked by the mouse:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Button1Down:Connect(function()
local model = mouse.Target:FindFirstAncestorOfClass('Model')
if model then
local clickedPlayer = game.Players:GetPlayerFromCharacter(model)
if clickedPlayer then
print(clickedPlayer.Name)
end
end
end)
It doesn’t work, but 3 years ago yes. Any solutions?
The parent of the local script is StarterPlayerScript