I made a test animation and for some reason it does not work.It does not return anything in the output.Could anyone help?
local mouse = game.Players.LocalPlayer:GetMouse()
local running = false
anim=Instance.new("Animation",workspace)
anim.AnimationId = "http://www.roblox.com/Asset?ID=291317454"
function bazinga()
for _, idk in ipairs(script.Parent:GetChildren()) do
if idk.className == "Tool" then return idk end
end
return nil
end
mouse.KeyDown:connect(function (key) -- Run function
key = string.lower(key)
if string.byte(key) == 114 then
running = true
local t=workspace:FindFirstChild("HumanoidRootPart"):clone()
t.Parent=workspace:FindFirstChild("Player")
local animTrack = workspace:WaitForChild("Player").Humanoid:LoadAnimation(anim)
animTrack:Play()
local br=game.lighting.ParticleEmitter:clone()
br.Parent=game.Players.LocalPlayer.Character.Torso
end
end)

1 comment
Player already have HumanoidRootParts you dont need to clone one.