Hi so i was trying to make a cutscene and this kept happening.
It plays the wrong animation for some reason.
It doesnt give out a error and this is the script.
function onTouched(hit)
if hit.Parent:FindFirstChild("HumanoidRootPart") and hit.Parent.Name ~= "Killer" then
local root = game.Workspace.Killer.HumanoidRootPart
local position = script.Parent:FindFirstChild("Victim").Position
local ori = script.Parent:FindFirstChild("Victim").Orientation
local posx = hit.Parent:FindFirstChild("HumanoidRootPart").Position.X
hit.Parent:FindFirstChild("HumanoidRootPart").Position = Vector3.new(posx, position.Y, position.Z)
hit.Parent:FindFirstChild("HumanoidRootPart").Orientation = Vector3.new(ori.X, ori.Y, ori.Z)
root.Position = Vector3.new(posx, root.Position.Y, root.Position.Z)
root.Orientation = Vector3.new(root.Orientation.X, root.Orientation.Y, root.Orientation.Z)
hit.Parent:FindFirstChild("HumanoidRootPart").Anchored = true
root.Anchored = true
local clone = script.Parent.VictimAnim:Clone()
clone.Parent = hit.Parent
clone.Enabled = true
local clone2 = script.Parent.KillerAnim:Clone()
clone.Parent = root.Parent
clone2.Enabled = true
end
end
script.Parent.Touched:connect(onTouched)
Can someone please help me?