Solved Variables - What is possible wrong?

  • 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.

aescraft

Well-Known Member
Mar 1, 2017
295
13
0
37
code_language.skript:
    if lore of player's tool is "Speaker":
      if {numero.de.speaker} is not set:
        set {numero.de.speaker} to 0
      add 1 to {numero.de.speaker}
      set {speakerXcord::%{numero.de.speaker}%} to "%event-block's x-coordinate%" parsed as integer
      set {speakerYcord::%{numero.de.speaker}%} to "%event-block's y-coordinate%" parsed as integer
      set {speakerZcord::%{numero.de.speaker}%} to "%event-block's y-coordinate%" parsed as integer

It just returns <none>, as if nothing is stored in the variable.
Thanks.

Ok, this is what happens when you are working for 4 hours in a row in a skript.

The problem was to set to "%event-block's x-coordinate%" instead of "set to event-blocks x-coordinates". It doesn't need to be inside " and with % around.

code_language.skript:
    if lore of player's tool is "Speaker":
      if {numero.de.speaker} is not set:
        set {numero.de.speaker} to 0
      add 1 to {numero.de.speaker}
      set {speakerXcord::%{numero.de.speaker}%} to event-block's x-coordinate
      set {speakerYcord::%{numero.de.speaker}%} to event-block's y-coordinate
      set {speakerZcord::%{numero.de.speaker}%} to event-block's z-coordinate
      set {protecao.speaker::%{numero.de.speaker}%} to event-block's location

Now its working.
 
Last edited:
Coordinates aren't integers, they are decimals.
The coordinate I was getting was always 0.5ish
Like, 360.5. I wanted to set it to 360.
So I was trying to change it to integer.

But its solved now, thanks for the tip.
 
No problem, if you wanted a Integer you could have used
code_language.skript:
"%floor(event-block's x-coordinate)%" parsed as integer
 
No problem, if you wanted a Integer you could have used
code_language.skript:
"%floor(event-block's x-coordinate)%" parsed as integer
No need to convert it to a string and parse it as an integer.
 
Status
Not open for further replies.