1. Hey! Guest! The 36th GMC Jam will take place between February 27th, 12:00 UTC - March 2nd, 12:00 UTC. Why not join in! Click here to find out more!
    Dismiss Notice
  2. NOTICE: We will be applying a Xenforo update on Tuesday 25th of February. This means that from approximately 10:00 to 14:00 BST the forums will be offline (or possibly longer). Sorry for the inconvenience! Official Announcement here.

Not collision with var = Do something...

Discussion in 'Programming' started by Christopher A. Orestis, Feb 12, 2020.

  1. Christopher A. Orestis

    Christopher A. Orestis Member

    Joined:
    Jun 19, 2019
    Posts:
    15
    Hello, I would like to know how do the following: (This script is not working, would like to know how to fix this)

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    var Hit = Collision_Place_Meeting(x,y,object);
    var Number = 0;
    var Sure = 0;

    if (Number == 1 && != Hit)
    {
    Sure = 1;
    }
    else
    {
    Sure = 0;
    }
     
  2. Nocturne

    Nocturne Friendly Tyrant Forum Staff Admin

    Joined:
    Apr 13, 2016
    Posts:
    7,167
    First, what does the script Collision_Place_Meeting() return= And what is the script?

    Second, You declare Number as a local var and set it to 0, so in the If check it will never be equal to 1 as you've set it to 0 already.

    Third, the " != Hit" bit is wrong. You need to specify what isn't equal to Hit, eg:
    Code:
    if (Number == 1 && Number != Hit)

    Fourth (and not really an issue, but it's unnecessary code), you declare "Sure" as 0, so there is no need for the "else" statement, as Sure will be 0 already if the "if" returns false.
     
  3. Christopher A. Orestis

    Christopher A. Orestis Member

    Joined:
    Jun 19, 2019
    Posts:
    15
    My apologist if I was not clear. I went to fix my post since I found the answer, here is the answer.

    ---------------------------------------------------------------------------------------------------------------------------------------
    Event: Space pressed

    Code:
    if (vspeed = 0)
    {
    vspeed = 4
    }

    Event: Step

    vspeed += 0.4;
     

Share This Page