Blocking, Stunning, Slowing

Hey Does anyone know a alternative to boolvalues for things like stunning and if the player is blocking?

For now what I have is when a player is stunned / blocking / slowed their is a instance value (bool) that I place inside the character so I can check if they are in a certain state.

Is their a safe alternative to this that I can check on both server and client if they are stunned/ blocking / slowed

Ex.
Stun / How I handle the Stun

	--Create Variables
	local Time = TempTime or 1
	local RemovedCheck = false
	local EnemyHRP = EnemyChar
	local Stun = Instance.new("BoolValue")

	-- Configuring Stun
	Stun.Name = "Stun"
	Stun.Parent = EnemyHRP

	Stun.AncestryChanged:Connect(function()
		if Stun.Parent ~= Stun and RemovedCheck == false and game.Players:GetPlayerFromCharacter(EnemyChar) then 
			game.Players:GetPlayerFromCharacter(EnemyChar):Kick("Exploiting: No Stun. Contact our team moderation if this was a error if not appeal in our contact server")
		end


	end)
	task.wait(Time)
	RemovedCheck = true
	Stun:Destroy()

local RunService = game:GetService("RunService")

local Character = script.Parent

RunService.RenderStepped:Connect(function()

	if Character:FindFirstChild("Stun") or Character:FindFirstChild("eStun") then
		Character.Humanoid.WalkSpeed = 0
		Character.Humanoid.JumpPower = 0
	else
		Character.Humanoid.WalkSpeed = 16
		Character.Humanoid.JumpPower = 50
	end
	
	if Character:FindFirstChild("Slowed") or Character:FindFirstChild("eSlowerd") then
		Character.Humanoid.WalkSpeed = 4
		Character.Humanoid.JumpPower = 25
	else
		Character.Humanoid.WalkSpeed = 16
		Character.Humanoid.JumpPower = 50
	end
	
	
end)

you could use attributes: Instance Attributes

yep^ u can set attributes in the humanoid or you could have all the players states stored in a module script or perhaps just a normal script and change those values from remote events

Alright my only worry with the old one was just the security of it and make sure hackers cant just change these values at will

If it’s a server script that’s changing it and a server script that’s checking it then it’s fine

alright thank you for your time!

the thing you need to make sure of is that you arent firing when a state ends instead u should just make sure the player is only in one state at a given time otherwise exploiters can fire the blocking state and remain fighting making them invulnerable

this security can be achieved by clearing the other states when a new state is fired and then setting the fired state to true (serverside)

Completely missed this. Thank you!

In addition to this if things are kept within a single script state variables/flags (akin to a state machine) could be used.