Cannot Use Variables Here

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Daisy

Member
Sep 16, 2020
3
0
1
19
Hello Skripters! I'm looking for some help to an issue I'm having regarding an error I've been getting.
The error I receive on reload of the script is "Cannot Use Variables Here", and I'm not sure how to fix it.
Code:
on right click:
   set {_e} to clicked block's location
   if {genpos::{@whichidslot}::%player%::*} contains {_e}:
       if player is sneaking:
           if {b.%player%} is greater than or equal to {@upgradecost}:
               if {@whichidslot} is not {@upgradeid}:
                   send "Purchased upgrade for {@upgradecost}"
   here -->        set block at {_e} in {@world} to {@upgradeblock} #HERE IS THE ISSUE
                   make console execute command "eco take %player% {@upgradecost}"
                   remove {_e} from {genpos::{@whichidslot}::%player%::*}
                   add {_e} to {genpos::{@upgradeid}::%player%::*}
               else:
                   send "&cThis gen is already at the max level!"
           else:
               send "&cUpgrade costs ${@upgradecost}"
[doublepost=1600572275,1600570615][/doublepost]Nvm, I found that if I:
Code:
on right click:
   set {_e} to clicked block                          #I ALSO CHANGED THIS
   if {genpos::{@whichidslot}::%player%::*} contains {_e}:
       if player is sneaking:
           if {b.%player%} is greater than or equal to {@upgradecost}:
               if {@whichidslot} is not {@upgradeid}:
                   send "Purchased upgrade for {@upgradecost}"                                       
                   make console execute command "eco take %player% {@upgradecost}"
                   remove {_e} from {genpos::{@whichidslot}::%player%::*}
                   add {_e} to {genpos::{@upgradeid}::%player%::*}
                   set block at {_e} to {@upgradeblock}                                             #HERE IS THE FIX
               else:
                   send "&cThis gen is already at the max level!"
                   stop
           else:
               send "&cUpgrade costs ${@upgradecost}"
               stop
 
Status
Not open for further replies.