Fix my hitbox sometime hit sometime dosent

Sometime the hitbox touched the enemy they take dmg and sometime they dosent , i want to make it deal damage every single time if the hitbox touched the enemy so how should i fix it? here scripts

		local Hitbox = game:GetService("ServerStorage").Items.BlockItems.Hitbox:Clone()
			Hitbox.Parent = workspace.FX
			Hitbox.CFrame = Stand.PrimaryPart.CFrame * CFrame.new(0,0,-3)
			local HittedList = {}
			
			Hitbox.Touched:Connect(function(hitpart)
				if hitpart.Parent:FindFirstChildWhichIsA("Humanoid") and not hitpart:IsDescendantOf(char) then
					local enemy = hitpart.Parent
					if (table.find(HittedList,enemy) == nil) then
						table.insert(HittedList,enemy)
						if enemy:FindFirstChild("GetDamaged").Value == false then
							OutputEvent:FireAllClients(enemy, "FX", "RequestSFX", "NormalHitSFX")
							
							if enemy:FindFirstChild("Timestopped") then
								repeat
									wait()
								until not enemy:FindFirstChild("Timestopped")
							end
							
							OutputEvent:FireAllClients(enemy, "FX", "HitFX", "Normal")
							local vel = Instance.new("BodyVelocity",enemy.HumanoidRootPart)
							vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
							vel.Velocity = char.HumanoidRootPart.CFrame.lookVector * 1 + Vector3.new(0,0,0)
							deb:AddItem(vel,0.15)
							enemy:FindFirstChildWhichIsA("Humanoid"):LoadAnimation(ServerStorage.Items.Animations.HitAnim):Play()
							enemy:FindFirstChildWhichIsA("Humanoid"):TakeDamage(Stat.Damage)
							Functions.OnTouched(char, enemy, Stat.Damage)
							
							Functions.StunPlayer(enemy, 1.5)
						end
					end
				end
			end)
			
			deb:AddItem(Hitbox,.1)

You have to remove the enemy from the hittedlist after doing your calculations

that’s a function so i dont need to do it

then it will only work once then stop you know that right?


I do repeat

it doesnt matter, if the enemy is in the HittedList dictionary they wont be hit again.
Add

HittedList[enemy] = nil

after Functions.StunPlayer(enemy, 1.5)

hm thats table in the script
image

yes just add the code i gave you to that script at the line i specified. it should work then

nope still same , sometime work , sometime not work
https://gyazo.com/29bef0cb1b2cdf498213b64bffb7674d

the hitbox is working, something else that isn’t related to the hitbox isn’t working. probably the damage. also check the time stop ability make sure you aren’t mistakenly firing it.

i tried printing in every functions before, i find out sometime hitbox touched the hitbox cant detect enemy

Is this script in server ? Cause server doesnt have access to char variable

that’s in server script , this line cuz not enough character

Im confused as to what you are saying, are you saying you shortened it cause of dev forum character limit?