#i need help with the last line for changing the block to light gray wool
1 messages · Page 1 of 1 (latest)
What y mean
after a line that ends in :, you need to add an indent
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
change event-block location to light gray wool:
I cant do code block rn
with?
show me your current code
kk
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
set event-block to light gray wool
Ase you‘ve already been told: indent
i dont get it
Indent. After each condition, add either 2 spaces, 4 spaces or 1 tab
can u do it
no
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:
?
Self explanatory really
do it and show pls
thank u
permission: skript.test
trigger:
if {example} is not set:
send "This is an example message!" to player
loop all players:
send "Hello, %loop-player%" to loop-player
else if {example} is true:
send "This is another example message!" to player```
there we go
?
its an example
what that
so you understand how intendation works
so this?
do the same thing but with your skript
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
set event-block to light gray wool
exactly
but like, with tabs instead of spaces
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
set event-block to light gray wool
@supple holly
you only indent after a condition
(or an event)
yes
so is this right
no
do it
partially
if player is sneaking: #this is a condition; indent
if event-block is white wool: #this is a condition; indent
remove 100 from player's balance #this is an effect; dont indent
set event-block to light grey wool #use british spelling```
why british spelling >:(
oh no i just spoonfed and will be hated on by the entirety of minehut + 1
@supple holly
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
set event-block to light grey wool
what do you want me to do?
is it right?
Mostly
can u do it for me pls
You should only indent after the last line ends with a :
i been thing for 1 hour
and about that:
i already literally did it for you lol
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
set event-block to light grey wool:
that?
.
Can u do it for me
bruh
i literally (fuck, used literally wrong, pls dont kill me) just did it for you
everything behind a # is a comment that does not actually effect code
IDK WHAT U MEAN
if player is sneaking: #this is a condition; indent
if event-block is white wool: #this is a condition; indent
remove 100 from player's balance #this is an effect; dont indent
set event-block to light grey wool #use british spelling``` here it is again, because you apparently cant scroll up
so i just paste this in their
yes.
and the dont indent and stuff
the sentences behind the # are COMMENTS that do NOT AFFECT code
on right click:
if player is sneaking:
if event-block is white wool:
remove 100 from player's balance
set event-block to light grey wool
so this?
on right click: #this is an event; indent here
if player is sneaking: #this is a condition; indent
if event-block is white wool: #this is a condition; indent
remove 100 from player's balance #this is an effect; dont indent
set event-block to light grey wool #use british spelling
this?