region bug with skript

  • 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!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

FlamForEver

Member
Aug 10, 2023
24
0
1
17
hello. recently, when I use any command that includes an event, or any string that has to work with regions, the latter either doesn't work, or gives me this error:
"An internal error occurred while attempting to perform this command."
could someone please help me? thanks. in this skript for example, i want the player can execute the command "/podio" only if is inside the region named spawn, or spawnender. How can I do this?

skript:

Code:
command /podio:
    trigger:
        if "%region at player%" contains "spawn" or "enderspawn":
            if player has permission "re.use":
                send "&aStai per essere teletrasportato al podio... attendi" to player
                wait 5 seconds
                teleport player to location at -1381, 179, -321 in world "world"
                send "&aSei stato teletrasportato al podio con successo." to player
                stop
            if player has permission "guardiare.use":
                send "&aStai per essere teletrasportato al podio... attendi" to player
                wait 5 seconds
                teleport player to location at -1347, 164, -266 in world "world"
                send "&aSei stato teletrasportato al podio con successo." to player
                stop
            if player doesn't have permission "re.use":
                if player doesn't have permission "guardiare.use":
                    send "&cNon hai il permesso di usare questo comando." to player
        else:
            send "&cPuoi usare questo comando solo allo spawn. Di conseguenza, utilizza &b/spawn&c!"
 
hello. recently, when I use any command that includes an event, or any string that has to work with regions, the latter either doesn't work, or gives me this error:
"An internal error occurred while attempting to perform this command."
could someone please help me? thanks. in this skript for example, i want the player can execute the command "/podio" only if is inside the region named spawn, or spawnender. How can I do this?

skript:

Code:
command /podio:
    trigger:
        if "%region at player%" contains "spawn" or "enderspawn":
            if player has permission "re.use":
                send "&aStai per essere teletrasportato al podio... attendi" to player
                wait 5 seconds
                teleport player to location at -1381, 179, -321 in world "world"
                send "&aSei stato teletrasportato al podio con successo." to player
                stop
            if player has permission "guardiare.use":
                send "&aStai per essere teletrasportato al podio... attendi" to player
                wait 5 seconds
                teleport player to location at -1347, 164, -266 in world "world"
                send "&aSei stato teletrasportato al podio con successo." to player
                stop
            if player doesn't have permission "re.use":
                if player doesn't have permission "guardiare.use":
                    send "&cNon hai il permesso di usare questo comando." to player
        else:
            send "&cPuoi usare questo comando solo allo spawn. Di conseguenza, utilizza &b/spawn&c!"
Do you see my highlighted text? If not, click on 'see more' or whatever. Anyway, instead of [highlighted text] , use if player's region is "region" [or] "region":
 
thx for help, but it still doesn't work. this is the error:
ps: i'have remove the word on the skript "or" and now string of skript is "f player's region is "spawn" and not "if player's region is "spawn" or "spawnender":"
now the is error:

'player's region' is not an entity type (lucky.sk, line 1987: if player's region is "spawn":')
 
thx for help, but it still doesn't work. this is the error:
ps: i'have remove the word on the skript "or" and now string of skript is "f player's region is "spawn" and not "if player's region is "spawn" or "spawnender":"
now the is error:

'player's region' is not an entity type (lucky.sk, line 1987: if player's region is "spawn":')
Try region of player instead of player's region . My bad btw.
 
no problem man, you're not bad at all. but now i have another error:

'of' is not a direction (lucky.sk, line 2051: if region of player is "spawn":')
 
no problem man, you're not bad at all. but now i have another error:

'of' is not a direction (lucky.sk, line 2051: if region of player is "spawn":')
hmm... interesting. Try the word contains instead of is , and if that doesn't work, post the modified code in a code block so I can study it and try to find what is wrong. Also, are you using any skript addons?
 
yes, i have skript addon. thats is all addon of skript inside my server:

Skript, SkQuery, Ersatz, MundoSK, WildSkript, skUtilities, skRayFall, Umbaska, SharpSK.

also, my server version is 1.8.8 if this information is helpful.

code:

On right click:
if name of tool of player is "&a&lLucky&6&lBook":
if region of player "spawn" or "enderspawn":
chance of 30%:
give player an iron sword
remove book with name "&a&lLucky&6&lBook" from player's inventory
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
chance of 25%:
give player an iron axe
remove book with name "&a&lLucky&6&lBook" from player's inventory
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
chance of 15%:
give player 1 iron helmet
give player 1 iron chestplate
give player 1 iron leggings
give player 1 iron boots
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 1%:
give 1 of Iron Sword of sharpness 3 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 3%:
give player a diamond helmet
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 1%:
give player a diamond chestplate
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 1%:
give player a diamond boots
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 4%:
give player a diamond leggings
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 40%:
give player a golden apple
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.10%:
give player an enchanted golden apple
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 10%:
strike lightning at player
send "&aAttenzione al fulmine!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 5%:
teleport player to spawn
send "&aGiro sfortunato! Purtroppo la tua ricompensa era fasulla, sei stato riportato allo spawn... Ritenta sarai più fortunato!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.01%:
kill player
remove book with name "&a&lLucky&6&lBook" from player's inventory
wait 2 tick
send "&aPurtroppo ti è capitata la ricompensa peggiore... Pensa che c'è lo 0.01 per cento che capiti questa fine, la morte! Può capitare, ma non disperarti, ora corri a recuperare il tuo inventario!"
chance of 0.20%:
give player an ender pearl
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give player a diamond sword
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.01%:
give 1 of Diamond Sword of sharpness 4 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 40%:
give player a bow
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!"
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of power 1 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of power 2 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.30%:
give enchanted book of power 3 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.10%:
give enchanted book of power 4 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.05%:
give enchanted book of power 5 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.001%:
give enchanted book of power 6 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.0001%:
give enchanted book of power 7 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of sharpness 1 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.20%:
give enchanted book of sharpness 2 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.10%:
give enchanted book of sharpness 3 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.05%:
give enchanted book of sharpness 4 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.001%:
give enchanted book of sharpness 5 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of protection 1 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of protection 2 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of protection 3 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of protection 4 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of fire aspect 1 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of fire aspect 2 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 0.50%:
give enchanted book of fire aspect 3 to player
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
chance of 30%:
give player 5 arrows
send "&aCongratulazioni. Hai ricevuto la tua ricompensa!" to player
remove book with name "&a&lLucky&6&lBook" from player's inventory
 
yes, i have skript addon. thats is all addon of skript inside my server:

Skript, SkQuery, Ersatz, MundoSK, WildSkript, skUtilities, skRayFall, Umbaska, SharpSK.

code:
did you already try the word contains ?
 
nope, this is the error:
'of' is not a direction (lucky.sk, line 2123: set {_region} to region of player')
 
nope, whyyyy
error:
An internal error occurred while attempting to perform this command.
code:
command /prova:
trigger:
if player is in region {spawn}:
send "&aHello world!" to player
else:
send "&cNope bro" to player
 
ok, I modified the command, and now works:

command /prova:
trigger:
if player is in region "spawn" or "spawnender":
send "&aHello world!" to player
else:
send "&cNope bro" to player

but even though I am in the "spawn" or "spawnender" region it keeps giving me "nope bro"
 
ok, I modified the command, and now works:

command /prova:
trigger:
if player is in region "spawn" or "spawnender":
send "&aHello world!" to player
else:
send "&cNope bro" to player

but even though I am in the "spawn" or "spawnender" region it keeps giving me "nope bro"
wdym?
 
it doesn't work, but compared to before at least now in chat it gives me something. before it either gave me errors, or in chat it didn't respond at all
 
nope, this is the error:

'in region prova' is not an entity type (lucky.sk, line 2123: if player is in region prova:')
 
nope, this is the error:

'in region prova' is not an entity type (lucky.sk, line 2123: if player is in region prova:')
hmm... I have an idea.

Code:
on region enter:
    region is [region]
    set {boolean} to true

on region exit:
    region is [region again]
    set {boolean} to false

command /region:
    trigger:
        if {boolean} is true:
            [code]