I'd like to make a tool that only shows up for one player. So I enter a name and it only shows up for that player.
Is there a way to make a tool only show up for one player?
2 answers
I think what you mean is "How do I give a tool to only one player?"
This is a pretty simple feat to accomplish and we can do this by doing this..
Please read my notes carefully to fully understand!
--This is a table to hold the list of players' usernames along with the tool we want to give them
local plrSpecificTools = {
["UserName"] = game.ServerStorage:FindFirstChild("Tool")
}
game.Players.PlayerAdded:connect(function(p) --This is an event that will fire when a player joins our game
p.CharacterAdded:connect(function(c) --This is another event that will fire when the players character has been added to the Workspace (but not fully loaded)
if plrSpecificTools[c.Name] then --Checks to see if the players username is in the table (but also checks if the tool exists)
tool = plrSpecificTools[c.Name]:Clone() --Clones the tool
tool.Parent = game.Players:GetPlayerFromCharacter(c).Backpack --Puts the tool in the players backpack
end
end)
end)
If you need any help, please comment under my answer.
So if your trying to make a tool only visible to one player, You put the item in the players camera. You need to use welds and such to keep it in places in most terms.
You can put it in the camera using the following:
for i,v in pairs (tool:GetChildren()) do
v.Parent = game.Workspace.CurrentCamera
end
This line of code has to be placed in a localscript within the client (playergui, starterpack and so on)
You can keep parts welded by using the following
http://wiki.roblox.com/index.php?title=Weld
Something else you might be interested in, well at-least in the future is making somthing visible to anyone besides the player themselves (for example, on phantom forces they use a toned down, less laggy and detailed weapon for other players to view of another player) you can put it within the player's character, this only works in first person as anything on the character becomes transparent. Thats a easy lazy way.
Anyways you want to use welds and put the items in the players camera...
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I've got no idea what you mean. You need to give more context