Skript

Skript

786k Downloads

Setting default variable states with %player's uuid% results in an error.

Zaphara94 opened this issue ยท 2 comments

commented

Skript/Server Version

[22:45:38 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[22:45:38 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[22:45:38 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[22:45:38 INFO]: [Skript] Server Version: git-Paper-435 (MC: 1.20.4)
[22:45:38 INFO]: [Skript] Skript Version: 2.8.3 (skriptlang-github)
[22:45:38 INFO]: [Skript] Installed Skript Addons: 
[22:45:38 INFO]: [Skript]  - skript-placeholders v1.5.2 (https://github.com/APickledWalrus/skript-placeholders)
[22:45:38 INFO]: [Skript]  - skript-itemsadder v1.4.1
[22:45:38 INFO]: [Skript]  - skRayFall v1.9.28 (https://sk.rayfall.net/)
[22:45:38 INFO]: [Skript]  - SkQuery v4.1.10
[22:45:38 INFO]: [Skript]  - SkBee v3.4.2 (https://github.com/ShaneBeee/SkBee)
[22:45:38 INFO]: [Skript]  - Ersatz v1.0
[22:45:38 INFO]: [Skript]  - WolvSK v1.7.2
[22:45:38 INFO]: [Skript]  - ItemsAdder v3.6.3-beta-13 (devs.beer)
[22:45:38 INFO]: [Skript] Installed dependencies: 
[22:45:38 INFO]: [Skript]  - Vault v1.7.3-b131
[22:45:38 INFO]: [Skript]  - WorldGuard v7.0.10-SNAPSHOT+2260-c7319f1

Bug Description

When I go to set any variable's default state using %player's uuid% like so:

variables: 
    {waila::disabled::%player%} = false

I get the error:

Line 13: (CustomCommands.sk)
    Can't understand the type 'player's uuid'
    Line: {waila::disabled::%player%} = false

Expected Behavior

In the past, I used %player% in the variable at the top to set the default state, however with the coming changes to skript I figured I would get ahead of the ball and change over all of our variables in preparation. I was expecting this to work, as it does not error out in any other place in the script, just at the very top when you set it to a value.

Steps to Reproduce

I have tried this on 3 different scripts trying to set variables to either true/false as default and get the same error regardless. I can use %player% in the variable and it works with the setting "use player UUIDs in variable names" set to true, but if you just tell it to use the player's uuid, it throw the error every time.

Errors or Screenshots

variables: 
	{waila::disabled::%player's uuid%} = false

command /togglewaila [<text="">]:
	trigger:
		if arg-1 is "off":
			if {waila::disabled::%player's uuid%} is true:
				send "&aWAILA is already off for you! Please relog to take effect."
			else:
				execute console command "/pex user %player% add -wailat.ui"
				send "&aWAILA has been turned &cOFF&a. Please relog to take effect."
				set {waila::disabled::%player's uuid%} to true
		if arg-1 is "on":
			if {waila::disabled::%player's uuid%} is false:
				send "&aWAILA is already on for you! Please relog to take effect."
			else:
				execute console command "/pex user %player% remove -wailat.ui"
				send "&aWAILA has been turned &9ON&a. Please relog to take effect."
				set {waila::disabled::%player's uuid%} to false
		if arg-1 is not set:
			send "&cYou need to specify on or off."

image

variables: 
	{waila::disabled::%player%} = false

command /togglewaila [<text="">]:
	trigger:
		if arg-1 is "off":
			if {waila::disabled::%player's uuid%} is true:
				send "&aWAILA is already off for you! Please relog to take effect."
			else:
				execute console command "/pex user %player% add -wailat.ui"
				send "&aWAILA has been turned &cOFF&a. Please relog to take effect."
				set {waila::disabled::%player's uuid%} to true
		if arg-1 is "on":
			if {waila::disabled::%player's uuid%} is false:
				send "&aWAILA is already on for you! Please relog to take effect."
			else:
				execute console command "/pex user %player% remove -wailat.ui"
				send "&aWAILA has been turned &9ON&a. Please relog to take effect."
				set {waila::disabled::%player's uuid%} to false
		if arg-1 is not set:
			send "&cYou need to specify on or off."

image

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

Default variables don't have a reference to player so player's uuid won't work.
You have to make it %player% and with the default player variable name option set to true to convert to UUID, this will do that for your variables. So in otherwords, you don't have to change anything.

UUID is not a type, so it cannot be %uuid% as Skript registers UUID as a String.

Anything in percentages within the default variables structure has to represent a type classinfo name.

commented

The biggest issue I've come across when using %player% in the variables section at the top (even with parsing them as uuid in the config), is that they aren't actually being set on join like they should be. This leads to commands failing because I did not specify an "if not set" option, because I set the variable's default state in the top of the script. In the example above, a new player just joined and tried to use "/togglewaila on". The command returned nothing because the variable I set as default "false" in the top of the script was not respected, so the variable is left unset. It should have returned that waila was already on for them. The same is for one of my other scripts, a tape measure. The whole script is broken because the variables aren't being set at the top using %player% in them like they are supposed to be, even with the config option to convert that to uuid set to true.