Lagionaz, the best way to learn is to try. So I'll give you a short example of how it works, and you can try to figure it out from there.
Your object is a horse. During the 'step' event, your horse executes the following code:
self.dir = floor(random(4));
if (self.dir = 0)
{
x -= 1;
}
else if (self.dir = 1)
{
y -= 1;
}
else if (self.dir = 2)
{
x += 1;
}
else
{
y += 1;
}
Now, obviously, this code would not really look very good if you actually ran it, but for example purpose, let's pretend that that makes sense.
Now, say that you created an object that, when it's running, you want to pause the game. In the create even of that object, you'd put the code:
global.pause = true;
and in the destroy event, you'd put the code:
global.pause = false;
you would also need, at the point where your game starts, to put code that says:
global.pause = false;
if you hadn't set 'set uninitialised variables to 0' in your preferences.
Once you have that set up, go back int your hourse object, and alter the code this way:
[b]if (!global.pause) //if the game isn't paused[/b]
{
self.dir = floor(random(4));
if (self.dir = 0)
{
x -= 1;
}
else if (self.dir = 1)
{
y -= 1;
}
else if (self.dir = 2)
{
x += 1;
}
else
{
y += 1;
}
[b]}[/b]
This will make it so that the code that moved the horse only ever executes if the game is not paused, which the object will tell the game.
Just a tip for asking for help in the future, people are more willing to help you if you tell them what you have tried, instead of just jumping on here as soon as you have to do something. Additionally, if you have something else to say after you've already posted, and Ben has already said this but you obviously didn't listen, click on the 'modify' button on your old post instead of making a new post if no one else has posted in the topic yet. Posting in the same topic twice in a row is known as 'double posting' and is generally frowned upon in forums, which is one reason why the modify button is there - so that you can add more to your old post without double posting.