I’ve been trying to insert my sounds and animations into a table and have their indexes as a string which is their object names but I don’t know how to do that lol
I’m trying to achieve something like this:
local animations = {
["PunchAnim"] = part.PunchAnim;
["KickAnim"] = part.KickAnim;
}
Here’s my script:
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local animations = {
}
local sounds = {
}
task.spawn(function()
for _, z in pairs(shorp:GetDescendants()) do
if z:IsA("Animation") then
local anim = char:FindFirstChild("Animator", true):LoadAnimation(z)
table.insert(animations, anim)
end
end
for _, z in pairs(shorp:GetDescendants()) do
if z:IsA("Sound") then
table.insert(sounds, z)
end
end
end)