How do I create a random value ?

0 favourites
  • 11 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • how can i create a textbox that when i press " /roll x " it gives a value from 1 to x.

    this textbox needs to be activated when "/" is pressed and after that i need to be able to type inside that box without clicking on it.

    I need help on those above, even for the 1 of two at least if the other is impossible

    thanks in advance !

  • Create the textbox and in it's properties set enabled to no

    keyboard on / pressed

    • textbox set enabled
    • textbox set focussed

    i'm not sure what you mean by pressing " /roll x " so if you could explain that further?

  • He means a dice-roll like in mmo's

    When you type in the textbox "/roll 100" and press enter, a random generatet number between 1 and 100 will be shown.

  • yes thats i mean Cherico ... like wow on chat when press : /roll1000 a random generated number between 1 to 1000 be shown.

  • creating a random number isn't that hard just set the number to round(random(1,Number)) , where number is the number inputted by the player..

    but if you want the roll part in front of it, before being able to use the number typed, you should remove that part of the text and only use the number after converting it back to an integer..

  • Can you send capx.? No is just a personal dice with out othet player can roll .is GM tool ... I dont want to create 1000 clobal and million event to do looking for a simple way .. For one dice roll is easy between 1-20 when press roll20 iinside textbox show me a floor(random(1,20)) on text.. But if iwant to roll a diference number what we do???

  • is it important that the player types roll?

    are you planning to add other input possibilities?

    Just asking, because If the player were just to enter a number it would be much easier..

  • ok sorry the player can enter a number.. my mistake cause in my game i have alot player's you mean the player who play the game and no the player in game P . sorry i missunderstood what you mean player before

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • These are the basics..

  • you save my day

  • you save my day

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)