Author Topic: Idk what I'm doing wrong exactly with variables  (Read 77 times)

Antikore

  • YouTuber, Gamer and the developer of Castle Chamber.
  • Level 21: Magmus
  • *
  • Posts: 1573
  • Total likes: 15
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Idk what I'm doing wrong exactly with variables
« on: September 11, 2020, 08:39:57 PM »
Let me explain, I'm trying to do a defend dash system, however, my defend variable stays in 0.
Here are my three command prompts
Code: [Select]
//Player 1 - Create CP
local var defend = 0

Code: [Select]
//Player 1 - Looping CP
if defend > 0
defend - 1
if defend > 16
{
     color = yellow
     effect = diamond out
     remove hurt = true
}
else
remove hurt = false
<area name>[defend] //For testing

Code: [Select]
//Player 1 - Pick Key Press CP
if defend = 0
defend = 32

However, it just does nothing
Sorry because my English is not very good because I'm Spanish ;) :P

Antikore

  • YouTuber, Gamer and the developer of Castle Chamber.
  • Level 21: Magmus
  • *
  • Posts: 1573
  • Total likes: 15
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Idk what I'm doing wrong exactly with variables
« Reply #1 on: September 14, 2020, 11:44:32 AM »
*Bump*
Sorry because my English is not very good because I'm Spanish ;) :P

Antikore

  • YouTuber, Gamer and the developer of Castle Chamber.
  • Level 21: Magmus
  • *
  • Posts: 1573
  • Total likes: 15
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Idk what I'm doing wrong exactly with variables
« Reply #2 on: September 15, 2020, 09:31:58 AM »
Really? Anybody?
Sorry because my English is not very good because I'm Spanish ;) :P

Gizgord

Re: Idk what I'm doing wrong exactly with variables
« Reply #3 on: September 15, 2020, 10:34:22 AM »
did you try running two variables?
like 'defend' and 'defend_check'. it might help you out

Antikore

  • YouTuber, Gamer and the developer of Castle Chamber.
  • Level 21: Magmus
  • *
  • Posts: 1573
  • Total likes: 15
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Idk what I'm doing wrong exactly with variables
« Reply #4 on: September 15, 2020, 07:03:04 PM »
did you try running two variables?
like 'defend' and 'defend_check'. it might help you out
wdym exactly?
Sorry because my English is not very good because I'm Spanish ;) :P

Gizgord

Re: Idk what I'm doing wrong exactly with variables
« Reply #5 on: September 16, 2020, 06:44:03 AM »
Code: [Select]
//Player 1 - Pick Key Press CP
if defend = 0
defend = 32
let's say here, wouldn't this be better if you did something like:
if defend_check = 0
defend = 32

maybe this happens simply because Command Prompt doesn't recognize the variables. I had a problem like that before. try running this code with 'game var's in place
« Last Edit: September 16, 2020, 06:44:26 AM by Gizgord »

Antikore

  • YouTuber, Gamer and the developer of Castle Chamber.
  • Level 21: Magmus
  • *
  • Posts: 1573
  • Total likes: 15
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Idk what I'm doing wrong exactly with variables
« Reply #6 on: September 16, 2020, 09:42:53 AM »
let's say here, wouldn't this be better if you did something like:
if defend_check = 0
defend = 32

maybe this happens simply because Command Prompt doesn't recognize the variables. I had a problem like that before. try running this code with 'game var's in place
okay, lets see
Sorry because my English is not very good because I'm Spanish ;) :P

Antikore

  • YouTuber, Gamer and the developer of Castle Chamber.
  • Level 21: Magmus
  • *
  • Posts: 1573
  • Total likes: 15
  • Enjoying Platform Builder from the very start
    • View Profile
    • PBuilder Resources
Re: Idk what I'm doing wrong exactly with variables
« Reply #7 on: September 16, 2020, 03:13:12 PM »
Fixed: I tested changing the name
Looks like defend or defending doesn't work, but defendStatus and defendingS does
So. Its a bug report now?

EDIT: Nvm, defend and defending are built-in variables. Defend is used for adding defend ability to the player, and defending is to check the player's defending status.
« Last Edit: September 17, 2020, 08:59:09 AM by Antikore »
Sorry because my English is not very good because I'm Spanish ;) :P