I am working on a script to change a character's animation pack due to its RigType. I want it so that it gets the humanoids Rig type and then it recognises it and if it is say for example R15 it will un-disable the script for R15 so it will use those animations to punch and visa versa. So far the error that i got is "R15 cannot be assigned to" then thats it. The script has two children One script in the script is called R15Animations and the other is R6Animations they both are the same script which is

(This Script works perfectly no need to edit this)

local CanDoDmg = true -- If the player can do damage
local Keybind = "f"
local dmg = 20 -- How much damage the player takes
local punch_level = 0
local punch_animations = {script:WaitForChild("Animation1"), script:WaitForChild("Animation2"), script:WaitForChild("Animation3")}

local plr = game.Players.LocalPlayer
local mouse = plr:GetMouse()

mouse.KeyDown:Connect(function(key)
    if key == Keybind then
        if punch_level < 3 then
        punch_level += 1 -- increase punch level, unless it's already the maximum
            -- Abort the punch, because we don't have a 4th animation.
     -- If you'd like it do something else, please say so in a comment.
        end
        local anim = script.Parent.Humanoid:LoadAnimation(punch_animations[punch_level])
        anim:Play()

        -- Removed a wait() here

        script.Parent:WaitForChild("RightHand").Touched:connect(function(hit)
            if hit.Parent:WaitForChild("Humanoid") and CanDoDmg == true then
                hit.Parent.Humanoid:TakeDamage(dmg)
                CanDoDmg = false
                wait(1)
                CanDoDmg = true
            end
        end)

        local saved_punch_level = punch_level
        wait(1)
        if punch_level == saved_punch_level then
            -- This code is only executed if the player hasn't initiated another punch.
            punch_level = 0
        end
    end
end)

So i want it to recognise the Rig Type and according to that rig type un-disable the rig types animations therefore making it able to use those as punches but the other one to be disabled. I think I am close to doing it i just need a little help thanks.

Enum.HumanoidRigType.R15 = "R15"
Enum.HumanoidRigType.R6 = "R6"
local Players = game:GetService("Players")

local player = Players.LocalPlayer
local character = player.Character or player.Character:Wait()
local humanoid = character:WaitForChild("Humanoid")
 
if humanoid.RigType == "R15" then
	script.R15Animations.Disabled = false
else
	script.R6Animations.Disabled = false
end