Animations not working

Ok so here is my issue:
I have a local script within starter character scripts that is supposed to play different animations on click.

Here is the code:

–script fundamentals dont mess with this nerd
local character = script.Parent
local Players = game:GetService(“Players”)
local player = Players.LocalPlayer
local humanoid = character:WaitForChild(“Humanoid”)
local animator = humanoid:WaitForChild(“Animator”)
–M1ComboV1
local M1ComboV1 = Instance.new(“Animation”)
M1ComboV1.Parent = animator
M1ComboV1.Name = “M1ComboV1”
M1ComboV1.AnimationId = “rbxassetid://6874568006”
local M1ComboV1Track = animator:LoadAnimation(M1ComboV1)
–M1ComboV2
local M1ComboV2 = Instance.new(“Animation”)
M1ComboV2.Parent = animator
M1ComboV2.Name = “M1ComboV2”
M1ComboV2.AnimationId = “rbxassetid://6874585701”
local M1ComboV2Track = animator:LoadAnimation(M1ComboV2)
–M1ComboV3
local M1ComboV3 = Instance.new(“Animation”)
M1ComboV3.Parent = animator
M1ComboV3.Name = “M1ComboV3”
M1ComboV3.AnimationId = “rbxassetid://6874629131”
local M1ComboV3Track = animator:LoadAnimation(M1ComboV3)
–M1ComboV4
local M1ComboV4 = Instance.new(“Animation”)
M1ComboV1.Parent = animator
M1ComboV4.Name = “M1ComboV4”
M1ComboV4.AnimationId = “rbxassetid://6874693282”
local M1ComboV4Track = animator:LoadAnimation(M1ComboV4)
–limbs
local LA = character:WaitForChild(“Left Arm”)
local RA = character:WaitForChild(“Right Arm”)
local LL = character:WaitForChild(“Left Leg”)
local RL = character:WaitForChild(“Right Leg”)
local TR = character:WaitForChild(“Torso”)
local Head = character:WaitForChild(“Head”)
–mouse stuff
local mouse = player:GetMouse()
local mouseclickcount = 0
–actual code
mouse.Button1Down:Connect(function()
mouseclickcount = mouseclickcount + 1
if mouseclickcount == 1 then
M1ComboV1Track:Play()
elseif mouseclickcount == 2 then
M1ComboV2Track:Play()
elseif mouseclickcount == 3 then
M1ComboV3Track:Play()
elseif mouseclickcount == 4 then
M1ComboV4Track:Play()
mouseclickcount = 0
end
end)

This SHOULD be playing a different animation each mouse click, but it is not working. I do not know where the failure is or how to fix it because no errors are showing up in output when I test it. Does anybody know how to fix my issue?

Extra Data:
Machine: Windows 10
ROBLOX Studio Version: version-62aad8f11fd54230

If you need any more information to fix the issue, please ask for it, however I cannot guarantee that I can provide such data due to the fact I don’t have much information on the issue myself due to the output not showing me any errors.

3 Likes

Put in print commands in the function. With the value of mouse click count.

1 Like

Alright, will try it and update you if it works. Thanks for the suggestion.

Alright so, here’s the new code:

mouse.Button1Down:Connect(function()
mouseclickcount = mouseclickcount + 1
if mouseclickcount == 1 then
print(mouseclickcount)
M1ComboV1Track:Play()
elseif mouseclickcount == 2 then
M1ComboV2Track:Play()
print(mouseclickcount)
elseif mouseclickcount == 3 then
M1ComboV3Track:Play()
print(mouseclickcount)
elseif mouseclickcount == 4 then
M1ComboV4Track:Play()
print(mouseclickcount)
mouseclickcount = 0
end
end)

The prints confirmed that the thing was working by showing the numbers in sequence within the output every time I clicked, but the animations did not play. I will try using different animations (from ROBLOX) and see if it works. If those animations work then the source of the problem will be the animations and not the code, in which I can solve my issue from there.

Second reason I can think of is if you don’t own the animations DIRECTLY, as in if it isn’t owned by the group but by you in a group game, or if it isn’t owned by you if it is your game.

Perhaps you are right, because I do not own the animations of the ones being used in the script. They are made by the owner of the game I’m using the script in (I’m a developer in their game). The owner of the M1Combo animations are Algrease who is the owner of the game in question.

Oh, ok, yeah, it’s VERY troublesome to use roblox’s game sharing feature, try using a group, it’s much better. Although it should be visible for Algrease

1 Like

As in we should transfer the game to a group?
Or do you mean upload the animations to a group?

Or both?

Both! A game owned by 1 person makes it a lot harder to split funds with co-developers, give tester, and numerous other things! I would highly reccomend switching to a group for everything.