08-07-2011, 09:43 PM
(This post was last modified: 08-07-2011, 09:52 PM by watermelonman.)
function keyDown(c, hit)
if c == "b" then
local bomb = create("Box")
bomb.Name = "Bomb"
bomb.Size = Vec2D(2, 5)
bomb.Position = script.Parent.Flier.Position
if bomb.hit.Type = "Character" or "Box" then
local ex = create("Explosion")
ex.Position = bomb.Position
end
end
end
At the end of the script:
link(script.Parent.KeyDown, keyDown)
if c == "b" then
local bomb = create("Box")
bomb.Name = "Bomb"
bomb.Size = Vec2D(2, 5)
bomb.Position = script.Parent.Flier.Position
if bomb.hit.Type = "Character" or "Box" then
local ex = create("Explosion")
ex.Position = bomb.Position
end
end
end
At the end of the script:
link(script.Parent.KeyDown, keyDown)