This repository was archived by the owner on Aug 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Create vehicle
tbeck edited this page Sep 18, 2023
·
1 revision
Snippet that spawns a vehicle on player death
Creating a vehicle is as easy as that
event.On.PlayerDeath(func(p *alt.Player, killer *alt.Entity, weapon uint32) {
// Respawn the dead player
p.Spawn(alt.Vector3{0,0,72}, 0)
pos := p.Position()
pos.Y += 1.5
// Create an adder next to the player
veh, err := alt.CreateVehicle(alt.Hash("adder"), pos, p.Rotation())
if err != nil {
fmt.Println("vehicle model does not exist: ", err)
return
}
})This script will spawn an adder after a player dies, right next to him.
You encountered a problem 💥? Check out the Troubleshooting Guide!
If you can't find a solution there file a new issue in this repository or contact me on Discord.