Jump to content

A good moveto script for making repeating, linear-path vehicles?


Jeux

Recommended Posts

Currently trying to figure out a good vehicle script for when a player enters a certain worldspace. Not sure if I needed a trigger, but I made one anyway for when the player enters the worldspace through a door. Then that trigger is referencing the initially disabled activator with the vehicle model. The trigger plays host to the actual script.

 

I would very much perfer to have the activator hold the script, however.

 

scn flyingCarRepeat

ref hoverCar
short vx
short vy
short vz

Begin Gamemode

set vx to hoverCar.getpos x
set vy to hoverCar.getpos y
set vz to hoverCar.getpos z

if vy < 3000
set vy to vy + 1
hoverCar.setpos Y vy

else if vy >= 3000
hoverCar.setpos X vx
hoverCar.setpos Y vy
hoverCar.setpos Z vz

endif
end

Begin OnTriggerEnter

set hoverCar to GetLinkedRef
hoverCar.enable

end

 

I can almost guarantee that this doesn't work. I haven't messed with it too much. I'm just posting that code so one would have an idea for what I'm trying to do, which is simple for the most part.

Link to comment
Share on other sites

My apologies! It turns out that the script does work! And quite efficiently if I must say. Still, my question remains, for I still need to add features like timed, random activation and the activator running even when the player leaves and re-enters the cell.

 

Thanks, however, for the info.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...