Jump to content

On region enter.


mateiop4

Recommended Posts

Hello! Can someone help me with a skript? 

 

the code is this:

on region enter:
    region is "%Area1%"
    if {checkArea1::*} contains player's uuid:
        send "yes"
    
    else:
        cancel event
        send "no"

 

It gives me an error at ("%Area1%")

Can someone help me please? ASAP. Thanks!

Link to comment
Share on other sites

Remove the %'s, since Area1 is not an expression or variable like number of all players or similar, when checking a region you are comparing with a string, so that would be "Area1"

[<3]

DMs open - Discord » MrTibo#9659 | or send a forum message

Link to comment
Share on other sites

6 hours ago, MrTibo said:

Remove the %'s, since Area1 is not an expression or variable like number of all players or similar, when checking a region you are comparing with a string, so that would be "Area1"

Yeah but now it says "Can't compare a region to a text: ("Area1")

Link to comment
Share on other sites

6 hours ago, PrecedingMC said:

Post your updated code please.

on region enter:
    region is "Area1"
    if {checkArea1::*} contains player's uuid:
        send "yes"
    
    else:
        cancel event
        send "no"

Link to comment
Share on other sites

5 hours ago, Pocan said:

if "%region at player%" contains "Area1":

    your codes

 

2 hours ago, mateiop4 said:

on region enter:
    region is "Area1"
    if {checkArea1::*} contains player's uuid:
        send "yes"
    
    else:
        cancel event
        send "no"


Yeah he's correct Do:

 

on region enter:
	if "%region at player%" contains "Area1":
		#rest of your skript!

 

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

12 minutes ago, mateiop4 said:

 

Please send the skript reload error and send the full skript.

EDIT: this may be to you not having the required skript addons

 

Edited by Invislol

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

2 minutes ago, Invislol said:

Please send the skript reload error and send the full skript.

THE CODE:

on right click with prismarine shard:
    name of player's item is "Key 1"
    add player's uuid to {checkArea1::*}

on region enter:
    if "%region at player%" contains "Area1":
    if {checkArea1::*} contains player's uuid:
        send "yes"
    
    else:
        cancel event
        send "no"

 

THE ERROR:

 

 

Captură de ecran din 2021-05-15 la 19.02.52.png

Link to comment
Share on other sites

13 minutes ago, mateiop4 said:

 

Found the issue try

%region% (:D)

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

1 minute ago, mateiop4 said:

THE CODE:

on right click with prismarine shard:
    name of player's item is "Key 1"
    add player's uuid to {checkArea1::*}

on region enter:
    if "%region at player%" contains "Area1":
    if {checkArea1::*} contains player's uuid:
        send "yes"
    
    else:
        cancel event
        send "no"

 

THE ERROR:

 

 

Captură de ecran din 2021-05-15 la 19.02.52.png

Yeah I think you should try %region% That seams to be the issue!

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

2 minutes ago, mateiop4 said:

Nope 😞 it says the same thing

are you sure you have the required addons 

Aka: TuSke image.thumb.png.ba6ba69860222e38736b99f6eaa9316b.png
 

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

Not sure whats the issue then post a post in the help section of the forums!

5 minutes ago, mateiop4 said:

Yes, i have TuSke and also worldguard for regions

 

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

Just now, Invislol said:

Not sure whats the issue then post a post in the help section of the forums!

 

HEY i actually changed the contains into is and it works! But i cannot go in any region only if i have the uuid

 

Link to comment
Share on other sites

OMFG JUST REALIZED WHY

try

if "%region at player%" does not contain "region":
6 minutes ago, mateiop4 said:

Yes, i have TuSke and also worldguard for regions

 

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

Just now, mateiop4 said:

HEY i actually changed the contains into is and it works! But i cannot go in any region only if i have the uuid

 

Oh lol you got it at the same time I remembered (I had to look throught my old skripts)

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

I guess this is solved. Have a good day!

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

1 minute ago, Invislol said:

I guess this is solved. Have a good day!

No wait it is not! Because now it says no when i try to use mvtp or other stuff when i go in other regions! I want this to happen only in that region!

Edited by mateiop4
Link to comment
Share on other sites

3 minutes ago, mateiop4 said:

No wait it is not! Because now it says no when i try to use mvtp or other stuff when i go in other regions! I want this to happen only in that region!

#Fixed version of your skript

on right click with prismarine shard:
    name of player's item is "Key 1"
    add player's uuid to {checkArea1::*}

on region enter:
    if "%region at player%" contains "Area1":
    	if {checkArea1::*} contains player's uuid:
        	send "yes"
    
    	else:
        	cancel event
        	send "no"

 

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

Indention errors (Skript doesn't read it how you want it to read it when you indent like that )

Invislol 

• 4-5 years of skript experience
• 6 Months of active java experience
• 2 Years of javascript and python experience


unknown.png
[PATRON] RANK

Helpful Stuff:
Appeals and Reports  - Here | Minehut  Global And forums rules - Here

Link to comment
Share on other sites

10 minutes ago, Invislol said:

Indention errors (Skript doesn't read it how you want it to read it when you indent like that )

Soo it is almost done, but i have one slight problem. It says that the "else" needs to be put after an if. I don't know how to fix that. Almost doneee...

Captură de ecran din 2021-05-15 la 19.45.12.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...