Not running through the elseif

The script runs fine it runs the “weak 1” which is “L” meaning if it’s L it should run on to the next statement which will become “L-L” but it is not running to the next statement when the value is L
How can I fix?

local Moves = {}
local Combat = require(script.Combat)

Moves["Combat"] = function(player, Character,neededkey)
	
	local plr = game.Players:GetPlayerFromCharacter(Character)
	local CombatChain = Character.CombatChain.Strings	
	local gui = plr.PlayerGui.HealthGUI.Combo
	if neededkey == "L" then	 
	CombatChain.Value = neededkey
	Combat["Weak 1"](player, Character, Character.Humanoid) 
		gui.Text = CombatChain.Value
		print(CombatChain.Value)
	elseif CombatChain.Value == "L" then
		CombatChain.Value = CombatChain.Value.."-"..neededkey
		print("Combat2")
		Combat["Weak 2"](player, Character, Character.Humanoid) 
		gui.Text = CombatChain.Value
	elseif CombatChain.Value == "L-L" then
		Character = player.Character
		CombatChain.Value = CombatChain.Value.."-"..neededkey
		Combat["Weak 3"](player, Character, Character.Humanoid) 
		gui.Text = CombatChain.Value	
	elseif CombatChain.Value == "L-L-L" then
		Character = player.Character
		CombatChain.Value = CombatChain.Value.."-"..neededkey
		Combat["Weak 4"](player, Character, Character.Humanoid) 
		gui.Text = CombatChain.Value
	elseif CombatChain.Value == "L-L-L-L" then	
		Character = player.Character
		CombatChain.Value = CombatChain.Value.."-"..neededkey
		Combat["Weak 5"](player, Character, Character.Humanoid) 
		gui.Text = CombatChain.Value	
	end
end

return Moves

The script is skipping the elseif as the first of statement is always true (L). It should also detect if a combo hasnt been started yet something like this depending on the initial value of combat chain.

if neededkey == "L" and CombatChain.Value = "" then
1 Like

oof i don’t know how i forgot that thanks i been up for 24 hours tired and i’m working like it’s nothing

1 Like