The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defining a random x
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#1
Defining a random x

I want to set a random variable from 1 to 4 that will determine which entity out of 4 is activated, but I'm not sure how to connect the two things. But, I don't know how to call x when I am setting the script.

I know to set the random variable, I want to do:

SetLocalVarInt("OrbPiece", RandInt(1,4));

And to activate the orb when you enter the corresponding orb piece, doing something like this:

SetEntityActive("orbpiece_emerald_"+x, true);

Where x is set equal to the integer generated by the first script. So how do I set them equal to each other?

(This post was last modified: 04-23-2012, 10:54 PM by Damascus.)
04-23-2012, 06:07 AM
Find


Messages In This Thread
Defining a random x - by Damascus - 04-23-2012, 06:07 AM
RE: Defining a random x - by Your Computer - 04-23-2012, 07:08 AM
RE: Defining a random x - by Damascus - 04-23-2012, 07:23 AM
RE: Defining a random x - by Your Computer - 04-23-2012, 08:03 AM
RE: Defining a random x - by Knittel - 04-23-2012, 01:19 PM
RE: Defining a random x - by Damascus - 04-23-2012, 08:01 PM
RE: Defining a random x - by Cranky Old Man - 04-23-2012, 08:07 PM
RE: Defining a random x - by overscore - 04-23-2012, 08:10 PM
RE: Defining a random x - by palistov - 04-23-2012, 08:40 PM
RE: Defining a random x - by Damascus - 04-23-2012, 10:53 PM
RE: Defining a random x - by palistov - 04-24-2012, 01:06 AM
RE: Defining a random x - by Damascus - 04-24-2012, 01:19 AM
RE: Defining a random x - by palistov - 04-24-2012, 02:25 AM



Users browsing this thread: 1 Guest(s)