Re: Dropping bombs and other stuff.
I don't know if this works or no, but it should be something like this:
Code:
function Update(self)
if(UInputMan:KeyHeld(2)) and (self:IsPlayerControlled()) then -- if player controlled and B button is pressed then
self.dropbomb = 1
else
self.dropbomb = 0
end
if self.dropbomb == 1 then
local bomb = nil;
bomb = CreateTDExplosive("bomb preset name here"); -- creates your TDExplosive
bomb.Pos.X = self.Pos.X - #; -- '#' is the X value, '+' means to the left, '-' means to the right
bomb.Pos.Y = self.Pos.Y + #; -- '#' is the Y value, '+' means below the dropship's center, '-' is above it
MovableMan:AddParticle(bomb); -- add the particle to the scene
else
self.dropbomb = nil;
end
if(UInputMan:KeyHeld(7)) and (self:IsPlayerControlled()) then -- if player controlled and G button is pressed then
self.dropcrate = 1
else
self.dropcrate = 0
end
if self.dropcrate == 1 then
local crate = nil;
crate = CreateACRocket("crate preset name here"); -- creates your ACRocket
crate.Pos.X = self.Pos.X - #; -- '#' is the X value, '+' means to the left, '-' means to the right
crate.Pos.Y = self.Pos.Y + #; -- '#' is the Y value, '+' means below the dropship's center, '-' is above it
MovableMan:AddActor(crate); -- add the particle to the scene
else
self.dropcrate = nil;
end
end