so basically im wondering why print doesnt work on module script
when i write a simple print in the module
it doesnt error and it doesnt do anything
when i do this
--module
local animator, animation = script.Parent.Humanoid.Animator, script:WaitForChild("Animation")
local module = {}
for i, v in pairs{
"rbxassetid://7659151023";
"rbxassetid://7658585904";
} do animation.AnimationId = v
local animationtrack = animator:LoadAnimation(animation)
table.insert(module, animationtrack)
end
return module
--script
wait()
local module = require(script.Parent)
local a1, a2 = unpack(module)
print(a1,a2)
i dont really understand why it happens
to me i should be able to do both
I believe this is just because you’re not using parentheses on your for loop, thus your module is breaking and not getting to the print.
It also could be your WaitForChild not being able to find the Animation object within the Module.
Did you mean to look in the animator instead?
--module
local animator =script.Parent.Humanoid.Animator
local animation = animator:WaitForChild("Animation")
local module = {}
local data = {
"rbxassetid://7659151023";
"rbxassetid://7658585904";
}
for i, v in pairs (data) do animation.AnimationId = v
local animationtrack = animator:LoadAnimation(animation)
table.insert(module, animationtrack)
end
return module