Trying to get this animation to fire on the client, but it is refusing to do. It is weird cause I have another script that fires perfectly fine, but this one doesn’t.
Here is the script not firing the animation. The function itself works, because it does fire the event, just no animations play with it.
local userinputserv = game:GetService("UserInputService")
local event = game.ReplicatedStorage:WaitForChild("SpellPart3")
local intevent = game.ReplicatedStorage:WaitForChild("InteractionEvent")
local db = game:GetService("Debris")
local tweenserv = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local chara = player.Character or player.CharacterAdded:Wait()
local charaHum = chara:WaitForChild("Humanoid")
local animator = charaHum:WaitForChild("Animator")
local SingHit = Instance.new("Animation")
SingHit.AnimationId = "rbxassetid://13038848754"
local SingleHitTrack = animator:LoadAnimation(SingHit)
SingleHitTrack.Priority = Enum.AnimationPriority.Action
SingleHitTrack.Looped = false
local IntFold = chara:WaitForChild("Interactions")
local Hit = IntFold.HitInt
Hit.Changed:Connect (function()
if Hit.Value == 1 or Hit.Value == 2 then
local inQ = 1
local ValueSent = Hit.Value
intevent:FireServer(inQ, ValueSent)
SingleHitTrack:Play()
SingleHitTrack:AdjustSpeed(0.75)
end
end)
And here is the script that works for reference;
local userinputserv = game:GetService("UserInputService")
local event = game.ReplicatedStorage:WaitForChild("SpellPart3")
local intevent = game.ReplicatedStorage:WaitForChild("InteractionEvent")
local db = game:GetService("Debris")
local tweenserv = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local chara = player.Character or player.CharacterAdded:Wait()
local charaHum = chara:WaitForChild("Humanoid")
local animator = charaHum:WaitForChild("Animator")
local mouse = player:GetMouse()
local spell = script.Parent
local equipped = false
local debounce = false
local charging = false
local SlashAni = Instance.new("Animation")
SlashAni.AnimationId = "rbxassetid://12913730510"
local SlashAniTrack = animator:LoadAnimation(SlashAni)
SlashAniTrack.Priority = Enum.AnimationPriority.Action
SlashAniTrack.Looped = false
spell.Equipped:Connect(function()
equipped = true
end)
spell.Unequipped:Connect(function()
equipped = false
end)
userinputserv.InputBegan:Connect(function(input, gpe)
if not equipped then return end
if gpe then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 and not debounce then
local spellcode = "1Basic"
local InQ = 5
local Value = 1
event:FireServer(nil, spellcode)
intevent:FireServer(InQ, Value, ManaCost)
SlashAniTrack:Play()
SlashAniTrack:AdjustSpeed(0.75)
debounce = true
task.wait(3)
debounce = false
end
end)
Both scripts are also in startercharacterscripts. The priority for both are action as well and I made the animations myself so not a permission issue.