How to create a script to spawn a dropship?
I'm attempting to make a grenade that when thrown spawns a dropship loaded with two actors in it above it. I can't get it to do anything, at all, though.
Here's what i have so far...
Code:
function Update(self)
if self.Fuze then
if self.Fuze:IsPastSimMS(2000) then
local Dropship = CreateACDropShip("Drop Ship MK1")
local soldiera = CreateAHuman("Coalition Light", "Coalition.rte")
soldiera:AddInventoryItem(CreateHDFirearm("Assault Rifle", "Coalition.rte"));
soldiera:AddInventoryItem(CreateHDFirearm("Auto Pistol", Coalition.rte"));
Dropship:AddInventoryItem(soldiera)
local soldierb = CreateAHuman("Coalition Light", "Coalition.rte")
soldierb:AddInventoryItem(RandomHDFirearm("Assault Rifle", "Coalition.rte"));
soldierb:AddInventoryItem(RandomHDFirearm("Auto Pistol", "Coalition.rte"));
Dropship:AddInventoryItem(soldierb)
if Dropship then
Dropship.Pos = Vector(self.Pos.X,0)
MovableMan:AddActor(Dropship)
end
self:GibThis()
end
elseif self:IsActivated() then
self.Fuze = Timer()
end
end