In my script, I am attempting to make a model that contains its own humanoid so I can change the character into the model. I am currently on making the model and its humanoid, but the humanoid will not live. What is wrong with my script here?
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
repeat wait() until player.Character
local char = player.Character
mouse.KeyDown:connect(function(key)
key = key:lower()
if key == "v" then
char.Archivable = true
local clone = char:Clone()
local model = Instance.new("Model",game.Workspace)
local ball = Instance.new("Part",model)
ball.Name = "Head"
ball.Size = Vector3.new(5,5,5)
ball.BrickColor = BrickColor.new("Really blue")
ball.FormFactor = "Custom"
ball.Shape = "Ball"
ball.CanCollide = false
ball.TopSurface = "Smooth"
ball.BottomSurface = "Smooth"
local ball2 = ball:Clone()
ball2.Name = "Torso"
ball2.Parent = model
ball2.Size = Vector3.new(6,6,6)
ball2.Transparency = 0.3
local weld = Instance.new("Weld",ball)
weld.Part0 = ball
weld.Part1 = ball2
ball.Position = char.Torso.Position
ball2.Position = ball.Position
ball.Anchored = true
ball2.Anchored = true
local humanoid = Instance.new("Humanoid")
humanoid.MaxHealth = 100
humanoid.Health = 100
humanoid.Parent = model
end
end)

2 comments
I did make a weld... From 26 to 28...
I suppose it was not correct then, because mine has caused it to work fine.