When I hold E, a barrage animation plays, while damaging anyone that gets hit. When I press R or F while holding E (i have a bind for that in the script) and release E, the barrage animation continues to play, even though I release E. But if I press a key that doesn’t have a bind, the barrage animation continues to play and when I release E, the barrage animation stops. I’ve done some testing, and it’s not on the server. The remote event just doesn’t send at all. Here’s the local script that handles all of the keybinds:
Script
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local summon = RS:WaitForChild("Summon")
local action = RS:WaitForChild("Action")
local barrage = RS:WaitForChild("Barrage")
local player = game.Players.LocalPlayer
--// Summon
local db = false
local active = false
local cd = 2
--// End
--// Barrage
local barraging = false
local barrage_db = false
local barrage_cd = 1
--// End
--// Punch Combat
--///Punch
local ct = 0
local prev = 0
local curr = 0
local m1_cd = 0.5
local m1_db = false
--/// Heavy Punch
local m2_db = false
local m2_cd = 3
--// End
UIS.InputBegan:Connect(function(input, typing)
local stand = player.Character:FindFirstChildWhichIsA("Model")
if typing then return end
if input.KeyCode == Enum.KeyCode.Q then
if db == false and active == false then
active = true
db = true
summon:FireServer(active)
task.wait(cd)
db = false
elseif db == false and active == true then
active = false
db = true
summon:FireServer(active)
task.wait(cd)
db = false
end
else
if active then
if input.KeyCode == Enum.KeyCode.E then
if barrage_db == false then
barraging = true
barrage:FireServer(stand, true)
task.wait(barrage_cd)
barrage_db = false
if barrage_db == false then
barrage_db = true
task.wait(barrage_cd)
barrage_db = false
end
end
elseif input.KeyCode == Enum.KeyCode.R then
if m2_db == false then
m2_db = true
action:FireServer("HeavyPunch", stand)
task.wait(m2_cd)
m2_db = false
end
else
if barraging == false then
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if m1_db == false then
m1_db = true
curr = tick()
if curr - prev < 1 then
ct += 1
if ct > 4 then
ct = 1
end
else
ct = 1
end
action:FireServer("Punch", stand, ct)
prev = curr
task.wait(m1_cd)
m1_db = false
end
elseif input.KeyCode == Enum.KeyCode.F then
action:FireServer("TimeStop", stand, 8)
end
end
end
end
end
end)
UIS.InputEnded:Connect(function(input, typing)
if typing then return end
if active then
if input.KeyCode == Enum.KeyCode.E then
if barraging == true and barrage_db == false then
barraging = false
barrage_db = true
barrage:FireServer(player.Character:FindFirstChildWhichIsA("Model"), false)
task.wait(barrage_cd)
barrage_db = true
end
end
end
end)
game.ReplicatedFirst.GetStand.OnClientInvoke = function()
return player:FindFirstChildWhichIsA("Model")
end