#How to make a cooldown for a skill button UI on an item by using Component.
1 messages · Page 1 of 1 (latest)
<@&1050648858243379231>
Custom comp
CooldownMax attribute
Cooldown attribute [view script if you want since this is the actual cooldown]
When object is tapped
If cooldown ≤ 0 then
ExitScript
End
[Rest of the ability goes here]
Set cooldown = cooldown max
Now in the custom comp on the events tab select when starting and do
Infinite loop
Keep wait until cooldown ≠ 0
Keep loop until cooldown ≤ 0
Set cooldown - (0.6 x system.game.frame interval time) [this is just to delta time the cooldown]
I have to make custom comp to player or to the skill button?
customcomp to button only
all on button
I Know it's kind of late but i think you kind of misunderstood, I'm trying to say that every item will have its own cooldown. And I already made it and having a problem that I don't have any idea how I'm going to fix that.
"ZSCD" = Z SKILL COOLDOWN . This comp has at each item. So when you tap the button it makes the ZSCD = X. And it works the countdown works. But when we switch the item the another item has it's own countdown but when you switch it again the countdown resets.
i recommend to use system.frame interval time if you want it to be exactly seconds
anyways
the reason this happens is because how weapons work
they dont stay and the main problem with custom comps is that their attributes are reset when the object is respawned
to fix this, either use player variables or map variables since those stay forever
and there's third option to not use builtin weapons system but that's too complex for this
Wydm by builtin weapons
the existing weapons comp
i never use built in so
If I use in button comp can it be fixed?
i mean
anything can fix it, its just the built in inventory and weapons system is the problem, being that objects don't stay and get destroyed and respawn on equip and unequip