So i have made a blocking script, it works fine, but just with a single problem, there's a duration on how long you can hold X to block, once this ends you are forced to stop blocking, but the problem is once i release X before the duration ends, the next time i will block it's duration is cut down by a lot, so i hinted it's because i am using the wait() but i have no idea on how to fix this.
LocalScript -
UIS.InputBegan:Connect(function(input, IsTyping)
if IsTyping == false and Check == true then
if input.KeyCode == Enum.KeyCode.X then
Check = false
BlockingStart:FireServer()
print("Blocking Started")
wait(5)
print("5 Secs passed")
BlockingEnd:FireServer()
wait(1)
Check = true
end
end
end)

8 comments
thats why debounce is a thing.
https://developer.roblox.com/en-us/articles/Debounce
That is not the problem here...
I do not have a solution but you have not defined blockingstart or blockingend or UIS.
I think it's obvious that they both are remote events, and UIS is User input service.
yeah but in the script the remote events are not defined.
Is this the entire local script?
I don't know a lot srry