Block(f) stuck problem(WAITING FOR YOUR HELP)

I’m working on a game based on combat and kombat.
I’m thinking about an unusual problem right now, but I couldn’t solve it somehow.
The problem is with Block(f) in the game.
When you log into the game as a player, if you use the block(f) feature in the game normally, if you hold “f” without error, the player will block, that is, the defense, but if you want to use the block(f) feature again after dying once, if you do not hold down the “f” key when you press it. even the character remains in block(f) and cannot return to normal without dying.

local Values = require(game.ReplicatedStorage:WaitForChild("Combat"):WaitForChild("Values"))
script.Parent.OnServerEvent:Connect(function(plr,Action)
	local Char = plr.Character
	local Hum = Char:WaitForChild("Humanoid")
	if Action == "Start" then
		Values:CreateValue("BoolValue",Char,"Blocking",false,math.huge)
		Values:CreateValue("BoolValue",Char,"PB",false,.1)
		
		local BlockAnim = Hum:LoadAnimation(script:WaitForChild("BlockAnim"))
		BlockAnim:Play()
	end
	
	if Action == "Stop" then
		for i,v in pairs(Char:GetChildren()) do
			if v.Name == "Blocking" then
				v:Destroy()
			end
		end
		
		local AnimTracks = Hum:GetPlayingAnimationTracks()
		for i,v in pairs(AnimTracks) do
			if v.Name == "BlockAnim" then
				v:Stop()
				
				
			end
		end
	end
end)

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like

Where do you have the script located?
There’s a difference between StarterPlayerScripts and StarterCharacterScripts.

The block in the contents of the starterpack.

Dude, it had such an easy solution that I was able to remember it thanks to you.
Thank you :smiley:

The explanations for the script services are here:

** edit ** What was your ‘easy’ solution so others can read this post and find it.
Also, mark the post that answers it as the Solution.

1 Like

I put the block(f) script in “startercharacterscripts” and it was resolved.
For those who have this problem like me, there is an improvement from here.
If you are having this problem, drop the relevant script file into “startercharacterscripts”.
have a nice day. :smiley:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.