Solved Making an Area 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 community!

    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!

Status
Not open for further replies.

Adrihun

Member
Feb 1, 2017
368
6
0
Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes

Problem

I'm trying to make an area in my server that is a "dungeon", when players go in that area, they get slowness for 10 seconds, and blindness for 3 seconds. I don't know how to do it though, I tried searching the skUnity docs for 13 minutes but couldn't find anything. I really need this. Please, if you know how to do it, help.

Thanks.
 
@Kenmah
Thanks for the reply.

Sadly, I cannot use World Guard in my server, because it gives errors. Also, even if i could, it wouldn't be good, because i'm Trying to make a server that runs on 90-100% scripts.
 
code_language.skript:
if player is within {variable} to {variable2}:
This might work? Do what Pikachu said because I think that's the only way you can get where the player is without using other plugins.
 
@Pikachu and @White

code_language.skript:
Checks whether or not a certain location is included in a 3d cube with 2 endpoints.
Example:

if player is within {variable} to {variable2}

Those are variables -- Idon't get it?
 
@Pikachu and @White

code_language.skript:
Checks whether or not a certain location is included in a 3d cube with 2 endpoints.
Example:

if player is within {variable} to {variable2}

Those are variables -- Idon't get it?

mspaint_2017-05-22_21-57-04.png


variable & variable2 are locations.
code_language.skript:
if player is within {variable} to {variable2}
 
@Duetro Okay but how does Skript know where the variables are? Like do i put coordinates in the variables?
 
code_language.skript:
You can use it like WorldEdit or WorldGuard: (Define a Region)

//pos1:
set {variable} to location of location of player

//pos2:
set {variable2} to location of location of player
 
  • Like
Reactions: Adrihun
Easier way may be creating a region with worldguard + using the on region enter event.
 
  • Like
Reactions: Adrihun
@Duetro Thanks, I'll try downloading worldguard again and see if it is fixed or not, i'll try older versions aswell.

Thanks for trying to help me guys
[doublepost=1495488993,1495485160][/doublepost]There's no player in a periodical event (spawn.sk, line 58: if player is within {test} to {test2}:')
[doublepost=1495489033][/doublepost]also how will i do it like

every second in "world":
if player is within {Ruins1} to {Ruins2}:
send "ok"

because that will make server lag
 
@Duetro Thanks, I'll try downloading worldguard again and see if it is fixed or not, i'll try older versions aswell.

Thanks for trying to help me guys
[doublepost=1495488993,1495485160][/doublepost]There's no player in a periodical event (spawn.sk, line 58: if player is within {test} to {test2}:')
[doublepost=1495489033][/doublepost]also how will i do it like

every second in "world":
if player is within {Ruins1} to {Ruins2}:
send "ok"

because that will make server lag
It literally tells you the error.. in a periodical event there is no player... so to get a player you would need to loop all players and then use loop-player to get a single player.
 
@ChisleLP wont work

did /1 and /2 and did /check and it said no, also checked variables file and nothing there?

code_language.skript:
command /1:
    trigger:
        set {_Ruins1} to location of location of player
        send "works" to player
 
command /2:
    trigger:
        set {_Ruins2} to location of location of player
        send "works" to player
        
every second in "world":
    loop all players:
        if loop-player is within {_Ruins1} to {_Ruins2}:
            send "ok" to loop-player
            stop
        else:
            stop
            
command /check:
    trigger:
        loop all players:
            if loop-player is within {_Ruins1} to {_Ruins2}:
                send "yes" to loop-player
            else:
                send "no" to loop-player
 
You're using local variables which are deleted after the event ends. Use global variables.
Local Variable: {_var}
Global Variable: {var}
 
Okay so I changed it to Global.
Then i made first corner with /1, then second with /2. Then
if i do /check anywhere out of that place, it will say yes, but im 500 blocks away!
And it is spamming "ok" in chat. But i'm not in that place?

code_language.skript:
command /1:
    trigger:
        set {Ruinz1} to location of location of player
        send "works" to player
 
command /2:
    trigger:
        set {Ruinz2} to location of location of player
        send "works" to player
        
every second in "world":
    loop all players:
        if loop-player is within {Ruinz1} to {Ruinz2}:
            send "ok" to loop-player
            stop
        else:
            stop
            
command /check:
    trigger:
        loop all players:
            if loop-player is within {Ruinz1} to {Ruinz2}:
                send "yes" to loop-player
            else:
                send "no" to loop-player
 
Same thing with /check command?
code_language.skript:
every second in "world":
    loop all players:
        if loop-player is within {Ruinz1} to {Ruinz2}:
            send "ok" to loop-player
            stop
        else:
            broadcast "outside"
            stop
Replace your loop all players: code with this one.
Do the broadcast and send "ok" messages appear regardless of where the loop-player is?
 
Status
Not open for further replies.