i have some issues with this script, because this is like a trigger for making a key combination, so variable “timee” is a timer for if you didnt do any key combination after the timer then variables goes false and all that stuff, but if i do a combination right there, and then i trigger again this function the timer that i had before goes and then turn all false, i dont understand how to solve this
local module = {}
local abilityss, spec = require(game.ServerScriptService.Main["data stuff"].Standlist), require(game.ServerScriptService.Main["data stuff"].SpecStuff.SpecList)
function module.Start(player: any, typee: boolean)
local gui = player.PlayerGui.PlayerBar.Ultimate_Screen
local ui = player.PlayerGui.PlayerBar.Player_Ui
local timee = 10
local currentrage1 = player:WaitForChild("PvpFolder"):WaitForChild("RageFolder").RageAbility.Rage
local currentrage2 = player:WaitForChild("PvpFolder"):WaitForChild("RageFolder").RageSpec.Rage
ui.Visible = false
gui.Visible = true
player.Character:SetAttribute("Doing_Combination", true)
player.Data:WaitForChild("GuiBeingUse").Value = true
if typee == true then
player.Character:SetAttribute("Type_Combination", "ability")
else
player.Character:SetAttribute("Type_Combination", "style")
end
task.wait(timee)
if typee == true then
currentrage1.Value = 0
else
currentrage2.Value = 0
end
gui.Visible = false
ui.Visible = true
player.Data:WaitForChild("GuiBeingUse").Value = false
player.Character:SetAttribute("Doing_Combination", false)
player.Character:SetAttribute("Type_Combination", "none")
end
return module
this is the part that reset everything:
task.wait(timee)
if typee == true then
currentrage1.Value = 0
else
currentrage2.Value = 0
end
gui.Visible = false
ui.Visible = true
player.Data:WaitForChild("GuiBeingUse").Value = false
player.Character:SetAttribute("Doing_Combination", false)
player.Character:SetAttribute("Type_Combination", "none")
(this is on server)