This is a script that is in a Model, it's supposed to get the player's character which is in a StringValue and clone it and put it in another model. However, line 11 / 12 throws an error. Does anyone know how do I get around or fix this?
local eotd = game.ReplicatedStorage.EOTD eotd.Changed:connect(function() if eotd.Value ~= nil then local model = script.Parent["Employee Of The Day"] local player = game.Workspace:FindFirstChild(eotd.Value) for i, v in pairs(model:GetChildren()) do v:Destroy() end local character = game.Players[eotd.Value].Character character:Clone().Parent = script.Parent["Employee Of The Day"] print('NAC: Value changed') model:WaitForChild('Humanoid').MaxHealth = 0 model.Humanoid.Health = 0 model.Health:Destroy() for i, v in pairs(model:GetChildren()) do v.Anchored = true v.CanCollide = true end end end)
local player = game.Players.LocalPlayer local A = player.Character:GetChildren() A:Clone() A.Humanoid:Destroy() A.Animate:Destroy() A.Parent = script.Parent:FindFirstChild("Employee Of The Day!")
Add in all the rest.
local client=game.Players.LocalPlayer local it=Instance.new local mod=it("Model",workspace)
for _,v in pairs(client:GetChildren()) do v:Clone().Parent=mod end
You should turn the Archivable property of the model to true. If it is set false, then you cannot clone it.