#Skript Help

1 messages · Page 1 of 1 (latest)

fading solstice
#

Hello, I am trying to configure this but I don't know how to do it or how it is called

ocean trellis
#

Action bar

fading solstice
#

oh

#

ty

#

do you know why this isn't working maybe?

#
    loop all players:
        if loop-player is in region "dungeons":
        set action bar of loop-player to "&fTime Left: &a100"
      else:
        delete action bar of loop-player```
ocean trellis
#

What part isn't working

#

Any errors...?

fading solstice
#

yeah

exotic verge
#

you don't need to delete action bar, it automatically goes away after a second or so

fading solstice
#

line 5: expected 8 spaces but found 6
line 6: loop-player is not an nbt compound

fading solstice
exotic verge
#
every second:
    loop all players:
        if loop-player is in region "dungeons":
            send action bar "&fTime Left: &a100" to loop-player
exotic verge
#

nice

fading solstice
#

is it possible to make it so the timer goes down

exotic verge
#

yes

fading solstice
#

and when it goes down it sends something?

exotic verge
#

how often do you want it to go down, and when do you want it to start going down

fading solstice
#

I want it to start from 180 and go down to 0

exotic verge
#

when do you want it to start

#

like, if I just make it go from 180 to 0, it'll start doing so as soon as the server starts

#

and then it'll be stuck at 0, if you don't specify when it should reset

fading solstice
#

when the player enters the region

#

and it should reset when the player gets a certain permission

exotic verge
#
on region enter:
    if event-player is in region "dungeons":
        set {_timeLeft} to 180

        while player is in region "dungeons":
            remove 1 from {_timeLeft}
            send action bar "Time Left: &a%{_timeLeft}%" to player

            if player has permission "PERMISSION_HERE":
                teleport player to SPAWN_POINT_HERE

            wait 1 second
fading solstice
#

1 error

#

in line 2

#

line 221 = line 2

exotic verge
#

fixed?

fading solstice
#

let's see

#

no error but I don't have the action bar

exotic verge
#

did you enter the region naturally, or did you teleport inside

fading solstice
#

teleport

exotic verge
#

what did you use to teleport? skript?

fading solstice
#

I tped to the world then used spectator to get inside

exotic verge
#

okay but how are your players going to enter

fading solstice
#

in skript

#

with*

exotic verge
#

yes, I need to see that skript

fading solstice
#

alright

#

okay so

#

I made a portal with skript

#
  if region is "come":
    teleport player to {come}

command /set <text>:
    permission: set.admin
    trigger:
        if arg-1 is "come":
        set {come} to location of block at location of player```
tepid raft
#

indent

fading solstice
#

which lines to indent?

tepid raft
#

!indent

teal estuaryBOT
# tepid raft !indent

In skript, you need to maintain consistent indentation, meaning you cannot indent 1 line 5 spaces, and the next 7 spaces. Usually it’s recommended you use tabs, however.

A good rule of thumb is to always indent the subsequent line whenever the previous statement ends with a :, an exception to this is in command statements with items before the trigger such as permission: or aliases:

With conditional statements and loops, any code that is indented within the statement will be run as a part of the statement, other code will not be run within the statement. Here is an example of proper indentation:

https://i.imgur.com/PbfZ12M.png

fading solstice
#

I'm asking which lines to indent

tepid raft
#

this will tell you

fading solstice
#

Code the skript is broken

exotic verge
#

or, wait, I will

#

when you use an if, please indent the line

fading solstice
#

okay

autumn comet
#

any line that ends with : needs to add 1 indent next line

exotic verge
#

if something: something else here if something: something else here

fading solstice
#

I did indent

#

I just copied incorrectly

#

this is the full skript

#
    if region is "dungeon1":
        teleport player to {dungeon1}
    if region is "dungeon2":
        teleport player to {dungeon2}
    if region is "dungeon3":
        teleport player to {dungeon3}
    if region is "dungeon4":
        teleport player to {dungeon1}
    if region is "dungeon5":
        teleport player to {dungeon5}
    if region is "come":
        teleport player to {come}
        
command /set <text>:
    permission: set.admin
    trigger:
        if arg-1 is "dungeon1":
            set {dungeon1} to location of block at location of player
        if arg-1 is "dungeon2":
            set {dungeon2} to location of block at location of player
        if arg-1 is "dungeon3":
            set {dungeon3} to location of block at location of player
        if arg-1 is "dungeon4":
            set {dungeon4} to location of block at location of player
        if arg-1 is "dungeon5":
            set {dungeon5} to location of block at location of player
        if arg-1 is "come":
            set {come} to location of block at location of player```
autumn comet
#

if (something): creates a block, so the things are will only activate if it's true need to be 1 indent more to the right
an indent is either a tab or 4 spaces
(It can be more or less spaces, but I wouldnt recommend in your case)

exotic verge
#
on region enter:
    if region is "come":
        teleport player to {come}
        set {_timeLeft} to 180

        while player is in region "dungeons":
            wait 1 second

            remove 1 from {_timeLeft}
            send action bar "Time Left: &a%{_timeLeft}%" to player

            if player has permission "PERMISSION_HERE":
                teleport player to SPAWN_POINT_HERE

command /set <text>:
    permission: set.admin
    trigger:
        if arg-1 = "come":
            set {come} to location of block at location of player
#

^ this will teleport them, wait a second, then start the countdown

fading solstice
#

no the region "come" is to teleport them

exotic verge
#

yes

#

we want it to start when they teleport

#

am I wrong?

fading solstice
#

no like

autumn comet
fading solstice
#

the region come

#

is the portal to teleport them inside of the world

#

not outside

exotic verge
#

you said they teleport into the dungeon

#

which region do you use for that

#

I thought we wanted to start the timer as soon as they teleported in?

fading solstice
#

yes

autumn comet
#

so then starting it with come works

#

since come teleports them in the dungeon

fading solstice
#

oh

#

alright

fading solstice
#

that you set it as

#

if player has the permission for it

#

then he gets teleported back

exotic verge
#

you can remove the teleport and make something else happen, or just entirely remove that section (if you want nothing to happen)

fading solstice
#

skript is broken

exotic verge
#

restart your server

fading solstice
#

alright

#

did nothing

#

I even moved the lines to a different file

autumn comet
fading solstice
#

so when I go to the "portal" it doesn't tp me or add the action bar

autumn comet
#

do /sk reload scripts

#

does it work? does it give errors?

fading solstice
#

9 errors

autumn comet
#

show

fading solstice
#

alright

#

let me get on lunar so I can scroll up more

autumn comet
#

could also just do it on console so you can copy paste

fading solstice
#

showed nothing

#

wait

#

this is 7 errors

#

where is the other 3

#

found them

autumn comet
#

yeah you've got a lot of random errors happening accross multiple scripts

#

and idk which one is the one with the dungeons

fading solstice
#

there are no errors with the dungeon skript

autumn comet
#

it just... does nothing?

#

then debug

#

add broadcast lines after conditions

#

so you can know in game if the ifs are working

fading solstice
#

alright

#

I did the broadcast

#

and nothing

#

it does't even broadcast

autumn comet
#

do a broadcast at the event, does that even work?

fading solstice
#

I did this

#
    if region is "come":
        teleport player to {come}
        set {_timeLeft} to 180
        broadcast "Hello World"

        while player is in region "come":
            wait 1 second

            remove 1 from {_timeLeft}
            send action bar "Time Left: &a%{_timeLeft}%" to player

            if player has permission "access.dungeon":
                teleport player to {spawn}```
autumn comet
#

then the first if might be the issue

#

or the event

exotic verge
#

what exactly is wrong?

fading solstice
#

I don't know

exotic verge
#

what do you mean

#

are you getting errors? what isn't happening that should be happening

fading solstice
#

I don't get any errors

#

but when I get into the region

#

it doesn't broadcast anything

#

or put the action bar

exotic verge
#

then we know exactly what is wrong

#

the region, line 2

exotic verge
fading solstice
exotic verge
#

you can just throw it in somewhere

fading solstice
#

alright

#

that's what it sent

exotic verge
#

alright, you can delete that from your script now

#
on region enter:
    wait 2 ticks
    if "%region at event-player%" contains "come":
        teleport player to {come}
        set {_timeLeft} to 180
        broadcast "Hello World"

        while "%region at event-player%" contains "dungeon":
            wait 1 second

            remove 1 from {_timeLeft}
            send action bar "Time Left: &a%{_timeLeft}%" to player

            if player has permission "access.dungeon":
                teleport player to {spawn}
#

try this ^

fading solstice
#

did nothing

exotic verge
fading solstice
#

okay so

#

it teleports

#

and says hello world

#

but it doesn't give me the action bar

exotic verge
#

oh, my bad

exotic verge
fading solstice
#

still doesn't give me

exotic verge
fading solstice
#

dungeon

exotic verge
#

fixed

fading solstice
#

hmm

#

it teleported

#

showed the action bar

#

then teleported me back

exotic verge
#

you need to deop yourself

autumn comet
#

well it does say to tp if player has permission

fading solstice
#

and it did nothing

fading solstice
#

Code, you there?

exotic verge
#

oof

#

sorry I'm tired

fading solstice
#

I fixed it