-
What do you want to achieve?
Energy Wave (like dragon ball) system -
What is the issue?
When the InputBegan is started, the Charging looped animation is played and a remote event is fired onto the server
When the InputEnded is fired, the Charging looped animation is stopped and the Release animation is played and a remote event is fired onto the server
When the server fires back a remote event, the player is given a wait for a cooldown, the Release animation should be stopped but it doesn’t stop? The events are working fine, it’s just stopping the animation that is the problen
- What solutions have you tried so far?
I tried checking if the animation is playing, but it prints false yet the animation is visibly playing
local script in StarterCharacterScript:
local Player = game.Players.LocalPlayer
local UIS = game:GetService("UserInputService")
local rp = game:GetService("ReplicatedStorage")
repeat wait() until script.Skill1
local Kameha = script.Skill1
local active = false
local debounce = false
repeat wait() until Player.Character
local Character = Player.Character
local Hold = Player.Character.Humanoid:LoadAnimation(script.Skill1.Skill1.Hold)
local Release = Player.Character.Humanoid:LoadAnimation(script.Skill1.Skill1.Release)
local cooldown = 10
UIS.InputBegan:Connect(function(Input,isTyping)
if isTyping then
return
elseif Input.KeyCode == Enum.KeyCode.One then
if debounce == false and active == false then
debounce = true
Kameha:FireServer(active)
--------------------------------------------------------------------------
Hold:Play()-- play charging animation works
--------------------------------------------------------------------------
script.Skill1.Skill1.RemoteEvent:FireServer()
wait(10)
end
end
end)
UIS.InputEnded:Connect(function(Input,isTyping)
if isTyping then
return
elseif Input.KeyCode == Enum.KeyCode.One then
if debounce == true and active == false then
active = true
Kameha:FireServer(active)
----------------------------------------------------------------------------
Hold:Stop() -- stop charging animation works
Release:Play()-- play Firing animation works
----------------------------------------------------------------------------
script.Skill1.Skill1.RemoteEvent:FireServer()
wait(10)
end
end
end)
Kameha.OnClientEvent:Connect(function()
wait(cooldown)
debounce = false
-----------------------------------------------------------------------------
Hold:Stop()-- stop hold animation just in case
Release:Stop() -- the problem, this animation doesn't stop
-----------------------------------------------------------------------------
active = false
end)