How would you select a player, when you click on the player? And I'm thinking of also asking about how you would make it push the player backwards, and an animation pop up on you.
It depends what you mean by "Select a player."
To start out, if I were you I would probably write a script to insert a ClickDetector to each of the Player's limbs when they join the game, then write a script that detects when the ClickDetector is clicked.
function assignClick(Player) ClickDetector = Instance.new("ClickDetector") p = game.Workspace.Player:GetChildren() for i,v in pairs(p) do if v:IsA("Part") then ClickDetector.Parent = v else return end end end game.Players.PlayerAdded:connect(assignClick)
That script should assign ClickDetectors in each of the Player's limbs.
noooo i would not use click detectors. I would use the mouse in a LOCAL script.
local p = game.Players.LocalPlayer local m = p:GetMouse() function showprofile(player) -- change this to a gui, or whatever print(player.AccountAge) print(player.userId) print(player.Name) end m.Button1Down:connect(function() local target = m.Target if target and target.Parent and m then if game.Players:GetPlayerFromCharacter(target.Parent) then showprofile(game.Players:GetPlayerFromCharacter(target.Parent)) end end end)
using the mouse is a lot easier and cleaner than using a click detector.