I’m trying to tween an npc’s humanoid root part’s CFrame (Not position, I’ve seen what happens) But I get this error
16:33:48.942 Workspace.Umbra Monstrum.Umbra Monstrum GoUnderground:8: attempt to call a table value - Server - Umbra Monstrum GoUnderground:8
My code:
repeat
task.wait()
until (script.Parent):IsA("Model")
if script.Parent.Name == "Umbra Monstrum" then
local hrp = script.Parent:WaitForChild("HumanoidRootPart")
local ts = game:GetService("TweenService")
local tweeninfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In, 0, false)
local tween = ts:Create(hrp, tweeninfo, {CFrame = hrp.CFrame * Vector3(0, 5, 0)}) --Line 8
local hum = script.Parent:WaitForChild("Humanoid")
hum.Health = 3
hum.HealthChanged:Connect(function(health)
local max = hum.MaxHealth
if health*2 == max then
hum.WalkSpeed = 0
local animcontroller = hum:WaitForChild("Animator")
local anim = hum:WaitForChild("Shadow")
local shadowanimation = animcontroller:LoadAnimation(anim)
shadowanimation.Priority = Enum.AnimationPriority.Action3
shadowanimation:Play()
task.wait(1)
tween:Play()
end
end)
end
I thought line 8 (TweenService:Create()) should have a dictionary. What am I doing wrong?
Edit: