I want to make a script that will help me change people into a char when they join the game. This one is not working. Put this as a script.
function Intialize(character)
for i, child in pairs(script:GetChildren()) do
if child.className == "Script" or child.className == "LocalScript" then
local c = child:Clone()
c.Parent = character
c.Disabled = false
end
end
end
function Apply(obj)
if obj.className == "Humanoid" and obj.Health > 0 and obj.MaxHealth > 0 then
Intialize(obj.Parent)
end
for i, child in pairs(obj:GetChildren()) do
Apply(child)
end
end
Apply(game.Workspace)
game.Workspace.ChildAdded:connect(Apply)
Put this inside that script as a regular script.
wait()
ch = script.Parent
set = game.Workspace --This MUST be the original area.
id = "Alar Knight of Splintered Skies" --Do NOT Mess with it!!! Leave the next 14 lines alone.
parts = {"Right Arm", "Left Arm", "Right Leg","Left Leg","Torso","hats"}
names = {"ra","la","rl","ll","ts","ht"}
wait()
function CloneMesh(name)
local child = set:FindFirstChild(id .. " " .. name)
local result = nil
if child ~= nil and child.className == "CharacterMesh" then --Leave alone. Must be "CharacterMesh"
result = child:Clone()
result.Parent = ch
result = {target = result, clone = result:Clone()}
end
return result
end
for i=1, 5, 1 do
if parts[i] ~= nil and names[i] ~= nil then
do
local name1 = parts[i]
local name2 = names[i]
local mesh = CloneMesh(name1)
local part = ch:FindFirstChild(name1)
if mesh ~= nil and part == nil then
mesh.target:Remove()
mesh = nil
end
end
end
end
function CharacterRefresh()
local names = {""}
for id, name in pairs(names) do
for index, child in pairs(ch:GetChildren()) do
if child.className == name then
child.Parent = nil
end
end
end
end

2 comments
But what's wrong with mines? I want to be able to change the package.
I can't tell just looking at it but here is what I do to find an error. Start using pring("something") happened. Then look in the output to see what went wrong "Where it didn't print". Tell me where and I'll look at what part of your script didn't function.