If statement doesn't work with accessory types

  1. What do you want to achieve? A tool that clones the player when they click.

  2. What is the issue? My problem is that line 24 doesn’t detect the accessory type correctly even though I have 2 types that it could be. Also line 24 starts with “if Accessory.Acc…” and is in “FASHION HANDLER”.

  3. What solutions have you tried so far? The most advanced coding ai, and multiple hours of elbow grease.

local tool = script.Parent
local rig = game.ReplicatedStorage.Rig

local function FortNitePleAEFOrtnite()	
	local clone = rig:Clone()
	local player = tool.Parent
	
	-- SKIN COLOR HANDLER
	local SkinColor = player.Torso.Color
	clone.Head.Color = SkinColor -- BIG PROBLEM ??? IDK AAAAAA
	clone["Left Arm"].Color = SkinColor
	clone["Left Leg"].Color = SkinColor
	clone["Right Arm"].Color = SkinColor
	clone["Right Leg"].Color = SkinColor
	clone.Torso.Color = SkinColor
	
	-- FASHION HANDLER
	local shirt = player:WaitForChild("Shirt")
	local SC = shirt:Clone()
	local Pants = player:WaitForChild("Pants")
	local PC = Pants:Clone()
	local Accessory = player:FindFirstChildWhichIsA("Accessory")
	print(Accessory.AccessoryType)
	if Accessory.AccessoryType == ("Enum.AccessoryType.Hair") or Accessory.AccessoryType == ("Hair") then
		local AC = Accessory:Clone()
		local HeadHeight = clone.Head.Position
		AC.Handle.AccessoryWeld.Part1 = clone.Head
		clone.Head.Position = HeadHeight
		AC.Parent = clone
		PC.Parent = clone
		SC.Parent = clone

		clone.Parent = game.Workspace
	end
end

tool.Activated:Connect(FortNitePleAEFOrtnite)```

remove the “” of the Enum.AccesoryType.Hair

1 Like

Thank you, didn’t even notice it.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.