I noticed that Roblox auto replicates animation from the client to the server. So is it possible that your able to stop the replicated animation?
Example:
My Animation Based Hitboxes problem.
Player does combat animation in client, their combo reaches, let’s say 4. Their in cooldown so server sets them in cooldown, the cooldown would stop the player. But player is still able to play animation even in cooldown, which ruins the point of an cooldown.
I don’t want my hitboxes and animation to be in the server because their less responsive, increase server work load, and delayed (apparently).
You could always get players Animator and use the GetPlayingAnimationTracks method to get the playing tracks so you could stop them.
Why don’t you set a value or attribute under the player indicating if they’re on the cooldown? With this you could always read the value and if it’s false you play the animation.
function stopAnimation(Animator:Animator)
for _, animTrack in pairs(Animator:GetPlayingAnimationTracks()) do
if animTrack.Animation.Parent == game.ReplicatedStorage.animFolder then
animTrack:Stop()
end
end
end
I think he means setting an attribute in the player like…
--assuming you have the player variable
player:SetAttribute("animationState", false) --will set the state (false = stopped)
--you can then on the client
player:GetAttributeChangedSignal("animationState"):Connect(function()
--if animationState == false then stop the animation
end)
Yes that’s what I was talking about in the first part
For the other part, I was saying you could create an attribute indicating if the player is on cooldown or not from the server. To prevent the client from playing the animation, you would just check if this attribute exists and if its true
Edit: Btw use this function to stop all the playing animation tracks:
local function StopAllPlayingTracks(Character:Model)
local Humanoid = Character:FindFirstChildOfClass("Humanoid")
if not Humanoid then return end
local Animator = Humanoid:FindFirstChildOfClass("Animator")
if not Animator then return end
for I, X in Animator:GetPlayingAnimationTracks() do
X:Stop()
end
end