#Skript Help
1 messages · Page 1 of 1 (latest)
Action bar
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```
yeah
you don't need to delete action bar, it automatically goes away after a second or so
line 5: expected 8 spaces but found 6
line 6: loop-player is not an nbt compound
it didn't work when I just did the first 4 lines
every second:
loop all players:
if loop-player is in region "dungeons":
send action bar "&fTime Left: &a100" to loop-player
this works
nice
is it possible to make it so the timer goes down
yes
and when it goes down it sends something?
how often do you want it to go down, and when do you want it to start going down
I want it to start from 180 and go down to 0
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
when the player enters the region
and it should reset when the player gets a certain permission
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
fixed?
did you enter the region naturally, or did you teleport inside
teleport
what did you use to teleport? skript?
I tped to the world then used spectator to get inside
okay but how are your players going to enter
yes, I need to see that skript
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```
indent
which lines to indent?
!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:
I'm asking which lines to indent
this will tell you
Code the skript is broken
okay, replace your on region enter with mine
or, wait, I will
when you use an if, please indent the line
okay
any line that ends with : needs to add 1 indent next line
❌ if something: something else here✅ if something: something else here
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```
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)
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
no the region "come" is to teleport them
no like
the teleport puts them in the new region, so either will start the countdown correctly
the region come
is the portal to teleport them inside of the world
not outside
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?
yes
wait I just realized
that you set it as
if player has the permission for it
then he gets teleported back
yes, I made an assumption that, when the timer runs out, you want them to leave
you can remove the teleport and make something else happen, or just entirely remove that section (if you want nothing to happen)
skript is broken
restart your server
give details?
so when I go to the "portal" it doesn't tp me or add the action bar
9 errors
show
could also just do it on console so you can copy paste
showed nothing
wait
this is 7 errors
where is the other 3
found them
yeah you've got a lot of random errors happening accross multiple scripts
and idk which one is the one with the dungeons
there are no errors with the dungeon skript
it just... does nothing?
then debug
add broadcast lines after conditions
so you can know in game if the ifs are working
do a broadcast at the event, does that even work?
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}```
what exactly is wrong?
I don't know
what do you mean
are you getting errors? what isn't happening that should be happening
I don't get any errors
but when I get into the region
it doesn't broadcast anything
or put the action bar
on region enter:
send region to player
send yes if region is "come" else no```
do I need to replace this with what you sent?
no
you can just throw it in somewhere
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 ^
did nothing
I edited it, try again
okay so
it teleports
and says hello world
but it doesn't give me the action bar
oh, my bad
edited again
still doesn't give me
what is the name of the dungeon's region
dungeon
fixed
well it does say to tp if player has permission
Code, you there?
I fixed it