Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I fix " Players.Plexiious.Backpack.Combat:178: attempt to index function with 'Play'"?

Asked by 3 years ago

I am trying to make a script inside my combat script that has it so when I press F it plays the animation and blocks but I keep getting this error

 Players.Plexiious.Backpack.Combat:178: attempt to index function with 'Play'

Can Yall Help?

mouse.KeyDown:connect(function(key)

    if key == "f" then

        if game:GetService("UserInputService"):GetFocusedTextBox() ~= nil then return end 

        if char.OtherValues.Carrying.Value == true then return end

        if char.OtherValues.Carried.Value == true then return end

        if char.CombatValues:FindFirstChild("Swinging").Value == true then return end

        if char.DisableValues:FindFirstChild("Disable") then return end

        if char.OtherValues.Ragdoll.Value == true then return end

        if char.CombatValues.BlockNumber.Value <= 0 then return end

        if blockcooldown == true then return end

        blockcooldown = true

        script.BlockOn:FireServer()

        block:Play()

        Player.PlayerGui.HUD.ImageLabel.Container.Block.Visible = true

        wait(3)

        blockcooldown = false

    end

end)

mouse.KeyUp:connect(function(key)

    if key == "f" then

        script.BlockOff:FireServer()

        block:Stop()

        Player.PlayerGui.HUD.ImageLabel.Container.Block.Visible = false

    end

end)










print("Moves Loaded.")

1 answer

Log in to vote
0
Answered by 3 years ago

Nevermind, I forgot to add a variable for it to find the block animation.

Ad

Answer this question