Skript
Skript copied to clipboard
Function parameters parser bug
Skript/Server Version
[17:49:28 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[17:49:28 INFO]: [Skript] Skript's documentation can be found here: https://skriptlang.github.io/Skript
[17:49:28 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[17:49:28 INFO]: [Skript] Server Version: git-Purpur-1171 (MC: 1.16.5)
[17:49:28 INFO]: [Skript] Skript Version: 2.6.3
[17:49:28 INFO]: [Skript] Installed Skript Addons:
[17:49:28 INFO]: [Skript] - Repuska v2.8.9
[17:49:28 INFO]: [Skript] Installed dependencies:
[17:49:28 INFO]: [Skript] - Vault v1.7.3-b131
[17:49:28 INFO]: [Skript] - WorldGuard v7.0.5+3827266
Bug Description
function ts(uuid: string, s: string) :: boolean:
if {_uuid} is set:
if {_s} is set:
return true
return false
command /ts [<string>] [<string>]:
trigger:
set {_p} to player
set {_x} to ts(uuid of {_p}, "1")
send "%{_x}%"
ERRORS:
The function 'ts' requires at least 2 arguments, but only 1 is given.
Line: set {_x} to ts(uuid of {_p}, "1")
Expected Behavior
function should be fine and output is true.
Steps to Reproduce
function ts(uuid: string, s: string) :: boolean:
if {_uuid} is set:
if {_s} is set:
return true
return false
command /ts [<string>] [<string>]:
trigger:
set {_p} to player
set {_x} to ts(uuid of {_p}, "1")
send "%{_x}%"
Here is my code of producing this bug.
Errors or Screenshots
No response
Other
No response
Agreement
- [X] I have read the guidelines above and affirm I am following them with this report.
Probably due to worlds
type in ExprUUID it's reading both parameters as expression
A quick solution is to use this set {_x} to ts((uuid of player), "1")
Debugged, and the problem is the UUID expression accepts multiple types. So in this case Skript is thinking ts(uuid of {_p}, "1")
is ts(uuid of {_p} and "1")
for some reason, So it's thinking it's returning a single UUID and erroring. Probably confused about a single or multiple strings at a certain time.
This issue was found on Skript 2.6.3+ As version below 2.6.1 works fine.