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
#It is simply not subtracting 1 from the variable
1 messages · Page 1 of 1 (latest)
what are you even tryna do
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
1 because everytime I click in the inventory it would set the variable to 10 thus rendering the whole point of the rest of it useless
2 I did I just didnt upload that part after I changed it
Your first point is the error..
Local var is deleted after the event
After every click in this case
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
I strongly recommend using uuid variables
great apperently clicked item isnt a thing
Event-slot
Their*
Why though? How are they supposed to know that does anything? Its on you for not factoring that in
its too much work
also I forgot how to word it
...
player's-uuid right?
uuid of player
I dont remember
Just use {example::%player’s uuid%}
Instead of just %player%
when I started out I did use '%player’s uuid%' but I got lazy and used that
how u do that
just that one word is formated
This is it. Anytime you are storing information just use this (%player’s uuid% not %player%)
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%
Line 27 name of event-slot
ah
It might be the apostrophe if you copy pasted it. Try retyping it