Gesture System

Script Gesture System 2.3.1

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

Supported Skript Version
  1. 2.7
  2. 2.8
Supported Minecraft Versions
  1. 1.19
  2. 1.20
Allows users to perform any action you want by using customizable gestures. Uses custom events for maximum customizability.

This script requires Skript (obviously), SkBee (for the particles), and skript-reflect for most of the other stuff. It was coded using 2.6.4, 2.18.1 and 2.3 respectively.

Credit to @danny19990 on Discord who helped with the initial idea for this.

What is a gesture sequence?
  • A gesture sequence is any number of directions the user can move their cursor. The options are up, down, left, and right.
  • As an example, registering a gesture could be down using /gesture add up down - this would create an event (which can be used in any script) which would fire whenever the user performs the up down gesture.
On gesture event:
  • A custom event is registered which follows the syntax syntax gesture [[of] %gesture sequence%], which, for example, would accept any of the following as valid syntaxes for the gesture sequence of up down:
    • on gesture of up down
    • on gesture up down
    • on gesture:
      • if event-gesture is "up down":
  • The event will throw an error on reload if an unregistered gesture is used in a script file. For example, if a script contains on gesture of up down: as an event, but up down isn't a registered gesture, it will error.
  • The event currently has 2 event-values: player and gesture.
    • Having the player means that you can use, for example, the send effect, or pass said player to a function. It is referred to in the same way as any other event.
    • The gesture event-value is a new addition with the gesture system, which can only be used in the on gesture event. It can be called using the syntax [event[-| ]]gesture, which means event-gesture, event gesture and gesture are all valid. It simply returns, as a string, the gesture (e.g. for gesture up down, it would return "up down")
To register a gesture:
  • Use command /gestures add (gesture sequence)
    • The added gesture sequence should now be usable in the on gesture event.
To deregister a gesture:
  • Use command /gestures remove (gesture sequence)
    • If the removed gesture sequence was being used in an event, it will no longer execute that code, and on the next reload of the script will throw an error.
To list the registered gestures:
  • Use command /gestures list
Things that might be added soon:
  • Maybe more event-values (if I can properly figure out how the custom events work)
For a video of how this works, check out the following thread in the SkUnity Discord: https://discord.com/channels/135877399391764480/1072217309852213298/1157464113476292809
The original video at this link is no longer consistent with how the gesture system works now, but there is another video in the thread posted more recently which shows some of the changes.
  • Like
Reactions: edu1504 and eult
Author
cheezburga
Downloads
1,403
Views
1,403
First release
Last update
Rating
5.00 star(s) 1 ratings

More resources from cheezburga

Latest updates

  1. v2.3.1 - readded leeway option

    Readded the leeway option. Was removed because a version of this script with leeway was never...
  2. v2.3 - small fixes

    Changes - Some changes to variable naming, and changing player to UUID of player (to avoid...
  3. 2.7.x fix

    Changed the custom event to not call a function, as this was causing an error due to issues with...

Latest reviews

Cool script, exactly what i need
Hope you keep updating it
cheezburga
cheezburga
Thanks for the review. What kind of stuff would you hope to see in future updates? Or just maintain it to work on future versions?