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.