So I have a script that when you click on a player it gives you a gui. The click detector was in the Torso although if people don't have the regular block body it gets a bit glitchy. So I decided to put a part in the player instead. Currently it works although it does some weird things to the player when they walk. Here's the script. I'll also include a picture too.
Picture: http://prntscr.com/celoin
game.Players.PlayerAdded:connect(function(player)
wait(1)
local User = player.Name
player.PlayerGui.MyPortfolio.Name = User.."-Portfolio"
local Clone = game.Workspace[User].Torso:Clone()
Clone.Name = "Box"
Clone.CanCollide = false
Clone.Transparency = 1
Clone.LeftSurface = "Smooth"
Clone.RightSurface = "Smooth"
Clone.Parent = game.Workspace[User]
local Pairs = game.Workspace[User].Box:GetChildren()
for _,v in pairs(Pairs) do
if v.Name == "ClickDetctor" then
print(v.Name)
elseif v.Name == "Neck" then
print(v.Name)
else
v:remove()
end
end
game.Workspace[User].Box.Size = Vector3.new(2, 2, 3)
local Cd = Instance.new("ClickDetector")
Cd.Parent = game.Workspace[User].Box
Cd.MouseClick:connect(function(User1)
local GUI2 = player.PlayerGui[User.."-Portfolio"]:Clone()
GUI2.Parent = User1.PlayerGui
User1.PlayerGui[User.."-Portfolio"].Frame.Visible = true
end)
end)
