local player = [Link].
LocalPlayer
local UIS = game:GetService("UserInputService")
local RS = game:GetService("ReplicatedStorage")
local damageEvent = RS:WaitForChild("QTEDamage")
-- SETTINGS
local DAMAGE = 50
local MIN_TIME = 3
local MAX_TIME = 7
local QTE_TIME_LIMIT = 1.5
local keys = {
[Link].E,
[Link].Q,
[Link].F,
[Link].R
}
-- GUI
local gui = [Link]("ScreenGui")
[Link] = player:WaitForChild("PlayerGui")
local button = [Link]("TextLabel")
[Link] = [Link](0.1, 0.1)
button.BackgroundColor3 = [Link](255, 60, 60)
[Link] = true
[Link] = false
[Link] = gui
[Link] = [Link](0.5, 0.5)
local active = false
local expectedKey
-- FUNCTION TO START QTE
local function startQTE()
if active then return end
active = true
expectedKey = keys[[Link](#keys)]
[Link] = [Link]
[Link] = [Link](
[Link](10, 90) / 100,
[Link](10, 90) / 100
)
[Link] = true
local success = false
local connection
connection = [Link]:Connect(function(input, gp)
if gp then return end
if [Link] == expectedKey then
success = true
connection:Disconnect()
end
end)
[Link](QTE_TIME_LIMIT)
[Link] = false
if connection then connection:Disconnect() end
if not success then
damageEvent:FireServer(DAMAGE)
end
active = false
end
-- LOOP
[Link](function()
while true do
[Link]([Link](MIN_TIME, MAX_TIME))
startQTE()
end
end)