I have a script that doesn't execute properly in the Server, yet It works in Studio.

The "outfits" variable is equal to a folder inside of ReplicatedStorage

local function createCharacter(character)
	for i,v in pairs(outfits[character]:GetChildren()) do
		if v.Name == "Hair_Bool" then
			if v.Value == true then
				if gender == "Female" then
					game.ReplicatedStorage.Hair.Hair_Female:Clone().Parent = workspace.DataModel
				elseif gender == "Male" then
					game.ReplicatedStorage.Hair.Hair_Male:Clone().Parent = workspace.DataModel	
				end			
			end
		end
		if v.Name == "face" then
			v:Clone().Parent = workspace.DataModel.Head
		end
		if not v:IsA("StringValue") or not v:IsA("BoolValue") then
			v:Clone().Parent = workspace.DataModel
		end
		if v.Name == "Character" then
			script.Parent.Text = v.Value
		end
	end
end

-- Would be called like this:
-- createCharacter("Justin Bieber")

This bit of code basically detects whether the male chose Male or Female as a GUI and decides which gender of the hair to clone. Then clones the face, along with everything besides StringValues and BoolValues, then it changes a TextLabels name to the name of the character chosen. We'll just use Business man and Justin Bieber for an example that the text is changed to.

I simply cannot get any accessories to clone on the NPC. Yes, It's FE. I want it to clone client-sided so I won't have to create mass amounts of models.

1 comment

0

anybody? ;-;