#It is simply not subtracting 1 from the variable

1 messages · Page 1 of 1 (latest)

spiral jackal
#
on inventory click:
  if name of event-inventory is "&cCar":
    cancel event
    set {_numOfTries} to 10 if {_numOfTries} is not set
    if {_numOfTries} > 1:
      lockPickCarDoor(player)
      subtract 1 from {_numOfTries}
      send "%{_numOfTries}%"
    if {_numOfTries} = 0:
      close player's inventory
      set {_numOfTries} to 10
      
opaque crescent
#

what are you even tryna do

echo pagoda
#

Why set it if its not set? Its a local var so its not set, the condition is useless. Just set it to a global var

When checking if its 0 use else if

spiral jackal
echo pagoda
#

Your first point is the error..

#

Local var is deleted after the event

#

After every click in this case

spiral jackal
#

ur right

#

thx

#
on inventory click:
  if name of event-inventory is "&cCar":
    cancel event
    if clicked item is "&aPick Lock"
      set {numOfTries::%player%} to 10 if {numOfTries::%player%} is not set
      if {numOfTries::%player%} > 1:
        lockPickCarDoor(player)
        subtract 1 from {numOfTries::%player%}
        send "%{numOfTries::%player%}%"
      else if {numOfTries::%player%} = 0:
        close player's inventory
        set {numOfTries::%player%} to 10
#

there I changed it a bit

echo pagoda
#

I strongly recommend using uuid variables

spiral jackal
#

great apperently clicked item isnt a thing

echo pagoda
#

Event-slot

spiral jackal
#

yeah if someone changes their name its their loss

#

XD

echo pagoda
#

Their*

spiral jackal
#

?

#

i did

#

oh

#

whoops

echo pagoda
spiral jackal
#

its too much work

#

also I forgot how to word it

#

...

#

player's-uuid right?

#

uuid of player

#

I dont remember

echo pagoda
#

Just use {example::%player’s uuid%}

spiral jackal
#

ahh

#

thx

echo pagoda
#

Instead of just %player%

spiral jackal
#

how u do that

#

just that one word is formated

echo pagoda
spiral jackal
#

ignore the line 20 error

#

it will be fixed if the line 14 error is fixed

#
on right click on iron door:
  set {carLPTime::%player’s uuid%} to 0 if {carLPTime::%player’s uuid%} is not set
  if {carLPTime::%player’s uuid%} = 0:
    lockPickCarDoor(player)
    set {carLPTime::%player’s uuid%} to 30
    loop 30 times:
      subtract 1 from {carLPTime::%player’s uuid%}
      wait 1 second
  else:
    send "&cYou are tired and must wait %{carLPTime::%player%}% before lock picking another car!"
#

@echo pagoda

#

im tempted to switch it back to %player%

echo pagoda
#

Line 27 name of event-slot

spiral jackal
#

ah

echo pagoda
#

It might be the apostrophe if you copy pasted it. Try retyping it