local Tool = script.Parent.Parent
script.Parent.ClickDetector.MouseHoverEnter:Connect(function()
if not script.Parent:FindFirstChild("SelectionBox") then
local Select = Instance.new("SelectionBox")
Select.Adornee = script.Parent
Select.Parent = script.Parent
Select.Color3 = Color3.new(1, 1, 1)
Select.Transparency = 0.5
end
end)
script.Parent.ClickDetector.MouseHoverLeave:Connect(function()
if script.Parent:FindFirstChild("SelectionBox") then
script.Parent.SelectionBox:Destroy()
end
end)
local function Click(player)
Tool.Parent = workspace[player.Name]
end
script.Parent.ClickDetector.MouseClick:Connect(Click)