#quick question

1 messages · Page 1 of 1 (latest)

sleek perch
#

Anyone know why when i select any of the buttons all the the commands run at the same time in this script ,

harsh tide
#

nope i have no clue

sleek perch
harsh tide
#

put it in brackets

#

like

#

if (result.selection === 2) {}

#

then ur code

sleek perch
#

i have

harsh tide
#

no u havent

sleek perch
#

just didnt paste that part

harsh tide
#

well thats why thats running

#

because its testing the first argument

#

then running everything else because they arent in an argument

sleek perch
#

oh

#

i thought u meany {} over the whole thing mb

#

so where does it go?

harsh tide
#

if (result.selection === 2)

#

{}

#

if (result.selection === 2) {
//code
}

sleek perch
# harsh tide if (result.selection === 2) { //code }

if (result.selection === 2){ source.runCommandAsync('tell @p[scores={money=..1500}] §cYou dont have the funds for this!')
source.runCommandAsync('playsound random.orb @p[scores={money=1500..}]')
source.runCommandAsync('give @p[scores={money=1500..}] experience_bottle 64 ')
source.runCommandAsync('scoreboard players remove @p[scores={money=1500..}] money 1500')}

#

like that?

harsh tide
#

yea

#

format that tho

#

u can right click and press format documentation or smthin like that

sleek perch
#

alr

#

thank you

sleek perch
harsh tide
#

no clue

sleek perch
zinc dragon
zinc dragon