#i need help with the last line for changing the block to light gray wool

1 messages · Page 1 of 1 (latest)

hazy roost
#

set event-block to light gray wool

green tundra
#

Thx

#

@hazy roost

#

it now sets every block to light gray wool

hazy roost
#

wdym by every block

#

you need to indent

green tundra
#

What y mean

void echo
#

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

green tundra
#

That not it

#

@hazy roost can u help?

hazy roost
#

with?

green tundra
#

it dont work

#

the script

hazy roost
#

elaborate

#

any errors?

green tundra
#

no

#

it just makes all the blocks turn into the wool

hazy roost
#

show me your current code

green tundra
#

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

supple holly
#

Ase you‘ve already been told: indent

green tundra
#

i dont get it

hazy roost
#

Indent. After each condition, add either 2 spaces, 4 spaces or 1 tab

green tundra
#

can u do it

hazy roost
#

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:

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

green tundra
#

?

supple holly
#

Self explanatory really

green tundra
#

do it and show pls

hazy roost
#

sure ill do it

#

for you

green tundra
#

thank u

hazy roost
#
    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

green tundra
#

?

supple holly
#

its an example

green tundra
#

what that

supple holly
#

so you understand how intendation works

green tundra
#

so this?

hazy roost
#

do the same thing but with your skript

green tundra
#

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
#

exactly

green tundra
#

can u do it for minbe

#

oh

#

that right?

supple holly
#

but like, with tabs instead of spaces

green tundra
#

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

hazy roost
#

you only indent after a condition

supple holly
#

(or an event)

hazy roost
#

yes

green tundra
#

so is this right

hazy roost
#

no

green tundra
#

do it

hazy roost
#

partially

supple holly
#
  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```
hazy roost
#

why british spelling >:(

supple holly
#

oh no i just spoonfed and will be hated on by the entirety of minehut + 1

green tundra
#

@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

supple holly
#

what do you want me to do?

green tundra
#

is it right?

supple holly
#

Mostly

green tundra
#

can u do it for me pls

supple holly
#

You should only indent after the last line ends with a :

green tundra
#

i been thing for 1 hour

supple holly
#

and about that:
i already literally did it for you lol

green tundra
#

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?

green tundra
#

Can u do it for me

supple holly
#

bruh

green tundra
#

i been sitting here for 1 hour

#

i so dam confused

supple holly
#

i literally (fuck, used literally wrong, pls dont kill me) just did it for you

green tundra
#

just write it here without the indent stuff

#

i mean the words

supple holly
#

everything behind a # is a comment that does not actually effect code

green tundra
#

IDK WHAT U MEAN

supple holly
#
  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
green tundra
#

so i just paste this in their

supple holly
#

yes.

green tundra
#

and the dont indent and stuff

supple holly
#

the sentences behind the # are COMMENTS that do NOT AFFECT code

green tundra
#

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?

supple holly
#

use code blocks

#

please

green tundra
#

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?

supple holly
#

yes

#

(replace the spaces with tabs)

green tundra
#

it all good

#

thank u guys