This is my code right here. I have no idea if it's an easy fix or not.

function commands.invisible(sender, args)
	local playerinvis = args[1]
	if playerinvis == "me" then
		local character = sender.Character
		local characterClone = character:Clone()
		characterClone.Name = tostring(sender.Name).."'s Character"
		characterClone.Parent = ServerS
		local children = character:GetChildren()
		for _, child in pairs(children) do
			if child:IsA("MeshPart") or child:IsA("Part") then
				child.Transparency = 1
				elseif child:IsA("Accessory") then
					child:Destroy()
			end
		end
	end
end

1 comment

0

Oh by the way, the error is on line 6