Help with Enum.HumanoidRigType and humanoid:LoadAnimation

Hello I have a problem with this script
So it’s supposed to play the “Wave” emote that correspond to the player’s rig type
I feel like it’s a simple issue to fix yet I can’t figure it out, pls help

local hum = script.Parent.Humanoid

task.wait(1)

if hum.RigType == Enum.HumanoidRigType.R6 then
	local anim = hum:LoadAnimation("http://www.roblox.com/asset/?id=128777973") -- r6 wave id
	anim:Play()
else
	local anim = hum:LoadAnimation("http://www.roblox.com/asset/?id=507770239") --r15 wave id
	anim:Play()
end

Typing the URL will not work, You need a ‘Animation’ Instance.
Here, this will work.

local hum = script.Parent.Humanoid
local WaveR6 = Instance.new('Animation', hum.Parent)
WaveR6.AnimationId = "http://www.roblox.com/asset/?id=128777973"
local WaveR15 = Instance.new('Animation', hum.Parent
WaveR15.AnimationId = "http://www.roblox.com/asset/?id=507770239"

task.wait(1)

if hum.RigType == Enum.HumanoidRigType.R6 then
	local anim = hum:LoadAnimation(WaveR6)
	anim:Play()
else
	local anim = hum:LoadAnimation(WaveR15)
	anim:Play()
end```
1 Like

Ey it’s working now, Thanks dude

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.