I have a game and I want a selection box to appear when the mouse hovers over the player. This is the script I have so far:
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
mouse.Move:Connect(function(target)
if mouse.Target == nil then
wait()
elseif mouse.Target.Parent.Name == player.Name then
print("Cannot select self")
elseif mouse.Target:IsA("MeshPart") or mouse.Target.Name == "Head" then
print("Found "..mouse.Target.Parent)
local box = game:GetService("ReplicatedStorage").Objects.Select:Clone()
for i,v in next, mouse.Target.Parent:GetChildren() do
if v:IsA("MeshPart") or v.Name == "Head" then
box.Parent = v
end
end
end
end)
It errors and says 10: attempt to concatenate field 'Parent' (a userdata value)
