I am making a zombie game, I have a zombie which I want to add parts to (like a hat, for example). I used this script to do so:
local function weldBetween(a, b)
local weld = Instance.new("ManualWeld")
weld.Part0 = a
weld.Part1 = b
weld.C0 = CFrame.new()
weld.C1 = b.CFrame:inverse() * a.CFrame
weld.Parent = a
return weld;
end
script.Parent:WaitForChild("Torso")
for i,v in pairs(script.Parent:GetChildren()) do
for a,b in pairs(script.Parent:GetChildren()) do
if v:IsA("Part") and b:IsA("Part")then
weldBetween(v,b)
end
end
end
Anyway, my issue is that the zombie loses his walking animation because his leg is welded on, what can I do to stop this? If I don't weld him together wont he just fall apart?
Question number two is, how would I go about giving the zombie an animation for hitting someone, can I use cframe to do so, should I make an animation and upload it? Thanks.
