Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Is Pressing Key" does not work #7388

Open
1 task done
nshun1896 opened this issue Jan 4, 2025 · 2 comments
Open
1 task done

"Is Pressing Key" does not work #7388

nshun1896 opened this issue Jan 4, 2025 · 2 comments
Labels
2.10 Targeting a 2.10.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.

Comments

@nshun1896
Copy link

nshun1896 commented Jan 4, 2025

Skript/Server Version

[01:57:45 INFO]: [Skript] Skriptのエイリアス一覧はこちらからご覧いただけます: https://github.com/SkriptLang/skript-aliases
[01:57:45 INFO]: [Skript] Skriptのドキュメントはこちらからご覧いただけます: https://docs.skriptlang.org/
[01:57:45 INFO]: [Skript] Skriptのチュートリアルはこちらからご覧いただけます: https://docs.skriptlang.org/tutorials
[01:57:45 INFO]: [Skript] サーバーのバージョン: 1.21.3-82-5a60ffb (MC: 1.21.3)
[01:57:45 INFO]: [Skript] Skriptのバージョン: 2.10.0-pre1 (skriptlang-github)
[01:57:45 INFO]: [Skript] インストール済みのSkriptアドオン: None
[01:57:45 INFO]: [Skript] インストール済みの依存関係: None

Bug Description

inputting key just a moment will cause infinite while loop in the below script.

on player pressing of any input key:
	if event-inputkeys is forward movement key:
		wait a tick
		while player is pressing forward movement key:
			broadcast loop-counter and current input keys of player
			wait a tick

on player pressing of any input key:
	if event-inputkeys is forward movement key:
		wait a tick
		while current input keys of player is forward movement key:
			broadcast loop-counter and current input keys of player
			wait a tick

Expected Behavior

script in while loop should be run only while input key is pressed.

Steps to Reproduce

paste above code and run.

you had better add the code below into the last part of while loop above.

if loop-counter is more than 10:
   stop

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
@nshun1896
Copy link
Author

In other event like below, the condition "Is Pressing Key" works.
So, It seems that in the event "on player pressing of any input key", current input keys may be kept until the event stops.

on jump:
  wait a tick
  while player is pressing jump key:
    push player upward at speed 0.1
    wait a tick

@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. 2.10 Targeting a 2.10.X version release labels Jan 5, 2025
@sovdeeth
Copy link
Member

sovdeeth commented Jan 5, 2025

CondIsPressingKey needs to check for hasDelay and modify its behavior accordingly, when in PlayerInputEvents

@sovdeeth sovdeeth added the PR available Issues which have a yet-to-be merged PR resolving it label Jan 5, 2025
@APickledWalrus APickledWalrus added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Targeting a 2.10.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.
Projects
None yet
Development

No branches or pull requests

3 participants