Hello,
I am currently working on player stunning system (for my taser), where if players get stunned then they won’t be able to equip any tools…
For this to happen I have tried using Humanoid:UnequipTools() inside a while loop (while loop so as to not equip it continuously).
Here is what I tried out…
local disableTools = coroutine.create(function()
while stunned do
humanoid:UnequipTools()
wait()
end
end)
-- When stunned
coroutine.resume(disableTools)
-- When stunning is over
coroutine.yield(disableTools)
But the issue is that, whenever we try to equip the tool after getting stunned, it gets equipped for a few milliseconds after which the scripts forces to unequip it…
So I am trying to avoid this delay between equipping and unequipping…(which i have not idea how to do)
Thanks a lot for helping in advance!