Greetings, everyone.
I have the following script:
repeat wait() until game:IsLoaded()
local runService = game:GetService("RunService")
local debris = game:GetService("Debris")
local animToChange = ""
anim = game.Workspace.Interviewer.Humanoid:LoadAnimation(script.IdleAnim)
anim.Looped = true
anim:Play()
runService.RenderStepped:Connect(function()
stuff = game.Workspace.Interviewer:Clone()
for i, v in pairs(stuff:GetChildren()) do
if v:IsA("Part") or v:IsA("MeshPart") then
v.Anchored = true
end
end
stuff.Parent = script.Parent
debris:AddItem(stuff, 0.001)
end)
game.ReplicatedStorage.Events.LoadAnimation.OnClientEvent:Connect(function(id)
if id == "wave" then
print('wave')
anim = stuff.Humanoid:LoadAnimation(script.WaveAnim)
anim.Looped = true
anim:Play()
end
end)
I am trying to make it so the animation of the viewport model changes whenever I call the remote event. The error says that on the client event part, the Humanoid isn’t a valid part of the player model. Any ideas on how to fix that? Thanks!