Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- With this you can get player's name, but with click - Player:GetMouse() ---
- --- With setclipboard (auto-copy player name by clicking) ---
- local mouse = game.Players.LocalPlayer:GetMouse()
- mouse.Button1Down:Connect(function()
- if mouse.Target then
- local model = mouse.Target:FindFirstAncestorOfClass("Model")
- if model then
- local player = game.Players:FindFirstChild(model.Name)
- if player then
- setclipboard(player.Name)
- end
- end
- end
- end)
- --- With print (prints player name by clicking) ---
- local mouse = game.Players.LocalPlayer:GetMouse()
- mouse.Button1Down:Connect(function()
- if mouse.Target then
- local model = mouse.Target:FindFirstAncestorOfClass("Model")
- if model then
- local player = game.Players:FindFirstChild(model.Name)
- if player then
- print(player) --- if not work, then change to print(player.Name)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement