Hello i am trying to find a way to make a attack that does mutliple hits like a barrage.
1 Like
well assuming you want to add hits, try this:
local UserInputService = game:GetService("UserInputService")
local hits = 0
UserInputService.InputBegan:Connect(function(i, g)
if g then return end
if i.UserInputType == Enum.UserInputType.MouseButton1 then
hits += 1 -- increment hits
if hits >= 5 then
hits = 0
end
end
end)
2 Likes
Not really what i am looking for, I have the input as a keycode.
Well than change the inputtype to
Enum.KeyCode.E -- change to any key
Though still then i would have to press e from another punch, But what i am searching for has the hits add after a second so that it punches automatically.