-- Get the appropriate animation script based on the rig type
local animateScript = Model:WaitForChild("Animate")
local newScript = animateScript:Clone()
repeat wait() until newScript
animateScript:Destroy()
-- Rename the cloned script to "Animate"
newScript.Name = "AnimateSCript"
newScript.Parent = Model
Model:WaitForChild("AnimateSCript")
print("Animate found")
AddToViewportFrame(Model)
I’m pretty much trying to clone and use the animate script, but it does not work in-game, only in studio. Why?
There is only the error which I’ve attached, but nothing else is mentioned.
Using :WaitForChild() after parenting the script to it isn’t needed.
It seems you attached the wrong error line, that’s the stack showing where the error came from. What was the error itself? (It also appears the error comes from inside the cloned script, seeing that code would help too)