local Player = game.Players.LocalPlayer
local char = Player.Character or Player.CharacterAdded:Wait()
local head = char:WaitForChild("Head")
local ammo = 1
local Mouse = Player:GetMouse() -- NEW VARIABLE
local x = Instance.new("Part")
x.BrickColor = BrickColor.new("Maroon")
x.Shape = "Ball"
x.Material = "Neon"
x.TopSurface = "Smooth"
x.BottomSurface = "Smooth"
x.Anchored = false
x.CanCollide = true
x.Transparency = 0.5
x.Size = Vector3.new(3,3,3);
local y = Instance.new("Fire")
y.Size = 15
y.Heat = 5
Mouse.Button1Down:connect(function() --DETECTS CLICK/TAP
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=855830361"
local humanoid = script.Parent:WaitForChild('Humanoid')
humanoid:LoadAnimation(animation):Play()
wait(1.5)
if ammo == 1 then
local cl = x:Clone()
local cly = y:Clone()
local v = Instance.new("BodyVelocity")
v.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
v.Velocity = Player.Character.UpperTorso.CFrame.lookVector * 60
v.Parent = cl
cly.Parent = cl
cl.Parent = game.Workspace
cl.CFrame = Player.Character.UpperTorso.CFrame * CFrame.new(0,1,-5)
ammo = 0
game.Debris:AddItem(cl, 4)
wait(2)
ammo = 1
end
end)
-- THIS IS FOR CLICKING E
game:GetService("UserInputService").InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.E then
local animation = Instance.new("Animation")
animation.AnimationId = "http://www.roblox.com/asset/?id=855830361"
local humanoid = script.Parent:WaitForChild('Humanoid')
humanoid:LoadAnimation(animation):Play()
wait(1.5)
if ammo == 1 then
local cl = x:Clone()
local cly = y:Clone()
local v = Instance.new("BodyVelocity")
v.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
v.Velocity = Player.Character.UpperTorso.CFrame.lookVector * 60
v.Parent = cl
cly.Parent = cl
cl.Parent = game.Workspace
cl.CFrame = Player.Character.UpperTorso.CFrame * CFrame.new(0,1,-5)
ammo = 0
game.Debris:AddItem(cl, 4)
wait(2)
ammo = 1
end
end
end)