Hello I am making a stunlock system for my roblox game, I have tried 2 different ways Way 1. Was running a function in a module
function module.stun(HIT)
print(HIT.Stun.Value)
HIT.Humanoid.WalkSpeed = 0
HIT.Humanoid.JumpPower = 0
HIT.Stun.Value = true
print("stun2")
wait(0.3)
print("stun")
HIT.Humanoid.WalkSpeed = 10
HIT.Humanoid.JumpPower = 50
HIT.Stun.Value = false
print(HIT.Stun.Value)
end
It DOES print "stun2" and the first stun value but it does not print "stun" or second stun.value
Way 2. Was in a server script,
coroutine.wrap(function()
eneH.Parent.Stun.Value = true
print("poop2")
wait(0.4)
print("poop")
eneH.Parent.Stun.Value = false
end)()
end
It prints poop2 but not poop there are no errors in the output.

4 comments
what kind of variable is poop2 and poop no offense
haha I just name my variables weird stuff all the time
By any chance, are you using getfenv()? Does anything in the script assign
printorwait?nope I don't