How would I make an combat fight style animation changer GUI?

I have the gui but im stuck on the part where it change’s all the animations instead of one…
It’s not animate script you use for walking. My animations are under a folder.

How can i make a way for it to change the all animations and not only one?

1 Like

You will just need to loop through your animations and then change them through the loop using a for i,v in pairs(List) do

2 Likes

can you give me an example please using animations in it?

1 Like

As an example you would have the list being all the animations such as in your folder with the animations in it and if you have a way to just switch out animations such as it being Kick = LeftAnimation1 and being able to change it to a difference kick animation. Like in Here:

local NewStyleFolder = --where the folder is like
local CurrentAnimations = {
Kick = Animation1;
Punch = Animation5;
Hug = Animation4;
Push = Animation7;
} -- a list of animations you want to change.
for i,v in ipairs(NewStyleFolder:GetChildren()) do -- get children gets all the children in the folder
   if v:IsA('Animation') then
          local SelectedAnimation = CurrentAnimations[I]
        
      end
end
1 Like

may i use this to test it on my script??

1 Like

A SERVER SCRIPT
this what i did with what you gave me as an example

local CooldownTime = 20
local CD = false

local player = script.Parent.Parent.Parent.Parent.Parent.Parent
local char = player.Character
local MainModule = require(game.ServerScriptService:WaitForChild('MainModule'))
local Stats = MainModule.GetStats(player)

Attack1 = "rbxassetid://10605582338" 
					Attack2= "rbxassetid://10605585237" 
					Attack3 = "rbxassetid://10605587521" 
					Attack4 = "rbxassetid://10605590391" 
					Attack5 = "rbxassetid://10345165586" 
						IdleFlight = "rbxassetid://10605399708" 
						Ascend = "rbxassetid://10345169989" 
						Backward = "rbxassetid://10345175909" 
						Block = "rbxassetid://10345196188" 
					BlockDuringKB = "rbxassetid://10345203189" 
						Descend = "rbxassetid://10345211722" 
						FightingStance = "rbxassetid://10605606511" 
						FlyLeft = "rbxassetid://10345251172" 
						FlyRight = "rbxassetid://10345255774" 
						Forward = "rbxassetid://10605704539" 
						ForwardBoost = "rbxassetid://10346032382" 
						ForwardBoostLockOn = "rbxassetid://10345276671" 
						HeavyAttack = "rbxassetid://10345281699" 
						HeavyAttackDown = "rbxassetid://10345286505" 
							HeavyAttackUp = "rbxassetid://10345291431" 
							Rest = "rbxassetid://10346267455" 
						ScouterRead = "rbxassetid://10345308315" 
IdleStance = "rbxassetid://10346232316" 

script.Parent.MouseButton1Click:Connect(function()
	if player.Name == "Tamegogeta13" then
	local FightingStyle = player.FightingStyle
	if FightingStyle then
		FightingStyle.Value = 'Tame'


		if player.Backpack:FindFirstChild('In-Combat') == nil or Stats.CombatTag.Value == true then
			Stats.CombatTag.Value = false
      end
		char.Config.AttackSpeed.Value = 2.5
		local hum = char:WaitForChild('Humanoid')
		local Animations = char:WaitForChild('Client'):WaitForChild('Animations')
		local Attacks = Animations:WaitForChild('Fighting Style')
			
			local NewStyleFolder = Animations --where the folder is like
			
		
					

				local CurrentAnimations = {
					Attack1 = Attack1;
					Attack2 = Attack2;
					Attack3 = Attack3;
					Attack4 = Attack4;
					Attack5 = Attack5;
					IdleFlight = IdleFlight;
					Ascend = Ascend;
					Backward = Backward;
					Block = Block;
					BlockDuringKB = BlockDuringKB;
					Descend = Descend;
					FightingStance = FightingStance;
					FlyLeft = FlyLeft;
					FlyRight = FlyRight;
					Forward = Forward;
					ForwardBoost = ForwardBoost;
					ForwardBoostLockOn = ForwardBoostLockOn;
					HeavyAttack = HeavyAttack;
					HeavyAttackDown = HeavyAttackDown;
					HeavyAttackUp = HeavyAttackUp;
					Rest = Rest;
					ScouterRead = ScouterRead;
					IdleStance = IdleStance;
				} -- a list of animations you want to change.
			for i,v in ipairs(NewStyleFolder:GetChildren()) do -- get children gets all the children in the folder
				if v:IsA('Animation') then
					local SelectedAnimation = CurrentAnimations[i]

				end
			end
			for i,v in ipairs(Attacks:GetChildren()) do -- get children gets all the children in the folder
				if v:IsA('Animation') then
					local SelectedAnimation = CurrentAnimations[i]

				end
			end
		local AnimateScript = char:WaitForChild('Animate')
		AnimateScript.idle.Animation1.AnimationId = Animations:FindFirstChild('IdleStance').AnimationId
		AnimateScript.idle.Animation2.AnimationId = Animations:FindFirstChild('IdleStance').AnimationId
		if Animations:FindFirstChild('CustomWalk') then
			AnimateScript.walk.WalkAnim.AnimationId = Animations:FindFirstChild('CustomWalk').AnimationId
			end
	
	end

	print(FightingStyle.Value == 'Tame')
	end
end)	```

Sorry for the late response but if the children in the folder have the same name as the attacks in the table then you will need to actually do this:

Change This:
local SelectedAnimation = CurrentAnimations[I]
To This:
local SelectedAnimation = CurrentAnimations[v.Name] -- only if the name is the same if not you will have to rename it or something else
-- After you can then change the animations - id or something else to change the animation with the new style

Also I would suggest to put the animations already inside a table like this

local CurrentAnimations = {
Attack1 = "rbxassetid://10605582338" ;
					Attack2= "rbxassetid://10605585237" ;
					Attack3 = "rbxassetid://10605587521" ;
					Attack4 = "rbxassetid://10605590391" ;
					Attack5 = "rbxassetid://10345165586" ;
						IdleFlight = "rbxassetid://10605399708" ;
						Ascend = "rbxassetid://10345169989" ;
						Backward = "rbxassetid://10345175909" ;
						Block = "rbxassetid://10345196188" ;
					BlockDuringKB = "rbxassetid://10345203189" ;
						Descend = "rbxassetid://10345211722" ;
						FightingStance = "rbxassetid://10605606511" ;
						FlyLeft = "rbxassetid://10345251172" ;
						FlyRight = "rbxassetid://10345255774" ;
						Forward = "rbxassetid://10605704539" ;
						ForwardBoost = "rbxassetid://10346032382" ;
						ForwardBoostLockOn = "rbxassetid://10345276671" ;
						HeavyAttack = "rbxassetid://10345281699" ;
						HeavyAttackDown = "rbxassetid://10345286505" ;
							HeavyAttackUp = "rbxassetid://10345291431" ;
							Rest = "rbxassetid://10346267455" ;
						ScouterRead = "rbxassetid://10345308315" ;
IdleStance = "rbxassetid://10346232316" ;
}
2 Likes

I’ll give this a try and let you know

1 Like

still haven’t worked at all but i wont give up

1 Like

May I see how you have everything laid out such as the Fighting style thing and see what it has inside?

1 Like

animations are in a folder but but i found a way

1 Like