Author Topic: Vehicle PickUps  (Read 996 times)

basically, I wanna make a mod that its a box spawned on a brick, rotating, and whenever a vehicle runs it over, it gives a random item to the player. Like, fireballs, homing rockets, rockets, droppable land mines...

Like Bushido's Kart Racing Server last year?

basically, I wanna make a mod that its a box spawned on a brick, rotating, and whenever a vehicle runs it over, it gives a random item to the player. Like, fireballs, homing rockets, rockets, droppable land mines...
I'd suggest making a trigger, then testing when something enters it. From there, check if the class is a vehicle and change some field on the vehicle or the mounted player (you can decide which is the best). The field would be the index of your powerup that the driver just recieved (you'd have to create a list of all the powerups you wanted to include somewhere in the beginning of your code). Using a random number from getRandom(0,%amountOfPowerupsDefined), you could get a random powerup for the driver. If its just an item, then give them the item. If not, then do some more complex stuff, but that should be about it.


I'd suggest making a trigger, then testing when something enters it. From there, check if the class is a vehicle and change some field on the vehicle or the mounted player (you can decide which is the best). The field would be the index of your powerup that the driver just recieved (you'd have to create a list of all the powerups you wanted to include somewhere in the beginning of your code). Using a random number from getRandom(0,%amountOfPowerupsDefined), you could get a random powerup for the driver. If its just an item, then give them the item. If not, then do some more complex stuff, but that should be about it.

What is a trigger?

I'd suggest making a trigger, then testing when something enters it.

That won't be necessary; vehicles and items trigger collision events.

That won't be necessary; vehicles and items trigger collision events.
But aren't vehicle collisions like really buggy?