Im trying to make a Tool that can summon an ability after 3 times it has been activated
Problems
Ability Function never even works.
Debounce also doesn’t seem to work.
AbilityFX Doesn’t Load in.
Questions
Is there a way to fix my cooldown?
How would I make it so the FX Spawn at an accurate area around the field?
Script
local Tool = script.Parent
local Ability1Combo = 0
local RS = game:GetService("ReplicatedStorage")
local AbilityFX2 = RS:WaitForChild("AbilityFX2")
local Debounce = false
Tool.Activated:Connect(function()
if Debounce == false then
task.wait(1)
Ability1Combo = Ability1Combo + 1
else
if Debounce ~= false then
print("Ability 2 Is on Cooldown...")
end
end
end)
local function SummonAbility()
Debounce = true
print("Ability 2 Has Been Summoned")
local FXClone = AbilityFX2:Clone()
FXClone.Parent = workspace
FXClone.Position = script.Parent.Parent:WaitForChild("HumanoidRootPart").Position + Vector3.new(4,0,3)
task.wait(30)
Debounce = false
Ability1Combo = 0
end
if Ability1Combo == 3 then
Ability1Combo = 0
task.wait(0.5)
SummonAbility()
end
while true do
task.wait(0.5)
print(Ability1Combo)
end
22:52:38.793 Unable to cast Instance to CoordinateFrame - Client - Abilitys:27
22:52:38.793 Stack Begin - Studio
22:52:38.793 Script 'Workspace.NubblyFry.Dandilion Collecter.Abilitys', Line 27 - function SummonAbility - Studio - Abilitys:27
22:52:38.793 Script 'Workspace.NubblyFry.Dandilion Collecter.Abilitys', Line 40 - Studio - Abilitys:40
22:52:38.793 Stack End - Studio
Also, sorry if I didn’t say this sooner but, I changed the script a tiny bit.
The issue now is that only the base part will flip over, but the rest of the part won’t.
local function SummonAbility()
Debounce = true
print("The Ability Flower Power Has Been Summoned!")
local FXClone = AbilityFX2:Clone()
FXClone.Parent = workspace
FXClone:PivotTo(script.Parent.Parent:WaitForChild("HumanoidRootPart").CFrame)
FXClone.AbilityFXBASE.CFrame.Rotation = CFrame.Angles(0,0,90)
task.wait(0.5)
Ability1Combo = 0
Debounce = false
end