Forum

> > Stranded II > Scripts > How do know if you are NOT riding a unit
Forums overviewStranded II overview Scripts overviewLog in to reply

English How do know if you are NOT riding a unit

7 replies
To the start Previous 1 Next To the start

old How do know if you are NOT riding a unit

Corvallis5
User Off Offline

Quote
I want to make it so that when you are riding a wagon your maxhealth goes up, I know how to do that:
1
2
3
4
on:use {
ride;
maxhealth "unit",1,110;
}

but how do I make it so that it goes back down when you get off the wagon?

old Re: How do know if you are NOT riding a unit

Hurri04
Super User Off Offline

Quote
I'm not sure which one you want since you ask for different things in the title and the post but here you go anyway:

if you want to know if you're riding a unit, use
1
$bla=riding();
this will return the ID of the unit you're currently riding, if you are riding a unit. otherwise it returns 0.

if you want to get off a unit if you are riding one, use
1
getoff;
also, since you can also get off with the 'use' key again, you would need to check when you get off. here you have to use an event:
1
2
3
on:getoff {
	...
}
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview