local rp = game:GetService("ReplicatedStorage")
local summon = rp:WaitForChild("Summon")
local tweenservice = game:service("TweenService")
summon.OnServerEvent:connect(function(player,isactive)
local character = player.character
local humanoid = character.Humanoid
local Humrp = character.HumanoidRootPart
if isactive then
local Humrp = character.HumanoidRootPart
local stand = script:WaitForChild("Stand"):Clone()
stand.Parent = character
local weld = Instance.new("ManualWeld")
weld.Part0 = stand.PrimaryPart
weld.Part1 = Humrp
weld.C0 = weld.Part0.CFrame.ToObjectSpace(weld.Part1.CFrame)
weld.Parent = weld.Part0
local AnimControl stand:FindFirstChild ("Animcontrol")
local idle = AnimControl:LoadAnimation(script.idle)
idle:play()
local goal = {}
goal.c0=weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame)
goal.c1 = weld.Part0.CFrame:ToObjectSpace(weld.Part1.CFrame * CFrame.new(-3,1,2))
local info = TweenInfo.new(.5)
local tween = tweenservice:create(weld,info,goal)
tween:play()
else
end
end)
ERROR: ServerScriptService.Summon:24: attempt to index nil with 'LoadAnimation' Line:24

1 comment
LoadAnimation only works with the Humanoid and it's Animator.