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

Clamp function always returns a list #6488

Closed
1 task done
Phill310 opened this issue Mar 11, 2024 · 1 comment
Closed
1 task done

Clamp function always returns a list #6488

Phill310 opened this issue Mar 11, 2024 · 1 comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. functions Related to functions

Comments

@Phill310
Copy link
Contributor

Skript/Server Version

[18:03:26 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[18:03:26 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[18:03:26 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[18:03:26 INFO]: [Skript] Server Version: git-Paper-422 (MC: 1.20.4)
[18:03:26 INFO]: [Skript] Skript Version: 2.8.2 (skriptlang-github)
[18:03:26 INFO]: [Skript] Installed Skript Addons: 
[18:03:26 INFO]: [Skript]  - skript-gui v1.3 (https://github.com/APickledWalrus/skript-gui)
[18:03:26 INFO]: [Skript]  - SkBee v3.2.1 (https://github.com/ShaneBeee/SkBee)
[18:03:26 INFO]: [Skript] Installed dependencies: 
[18:03:26 INFO]: [Skript]  - Vault v1.7.3-b131
[18:03:26 INFO]: [Skript]  - WorldGuard v7.0.9+5934e49

Bug Description

Clamp function returns a list no matter how many numbers are provided which gives an error when trying to set a variable to its output.

Expected Behavior

Clamp function returns a number when given 1 input

Steps to Reproduce

command /demo:
    trigger:
      set {_demo} to clamp(0,2,5)

Errors or Screenshots

image

Other

No response

Agreement

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

Fusezion commented Mar 11, 2024

This sadly isn't an issue and is just a lack of function functionality there's no real way to decide at parse time if a function is single or plural until it's used

Solution that has been proposed once in discord I believe was to make a clamp %numbers% between %number% and %number% expression

@AyhamAl-Ali AyhamAl-Ali added enhancement Feature request, an issue about something that could be improved, or a PR improving something. functions Related to functions labels Mar 12, 2024
@Moderocky Moderocky added the PR available Issues which have a yet-to-be merged PR resolving it label Apr 15, 2024
@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 Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update. enhancement Feature request, an issue about something that could be improved, or a PR improving something. functions Related to functions
Projects
None yet
Development

No branches or pull requests

5 participants