#Playing animation when tool is active

10 messages · Page 1 of 1 (latest)

deep meadow
#

Hi, we're trying to figure out a way to make an animation play when equipping a tool. We followed a tutorial on youtube for this originally, which resulted in it doing nothing. We then changed a bit of code, and it still isn't working.

We used the code under the tool to fire the server:

local AbilityEvent = game.ReplicatedStorage.Char1Ability1

script.Parent.Equipped:Connect(function()
    AbilityEvent:FireServer()
end)

and then had a code in ServerScriptService to play the animation:

local AbilityEvent = game.ReplicatedStorage.Char1Ability1
local Animation = Instance.new("Animation")

Animation.AnimationId = "rbxassetId://18313934030"

AbilityEvent.OnServerEvent:Connect(function(plr)
    local char = game.Workspace:FindFirstChild(plr.Name)
    local hum = char.Humanoid
    local animTrack = hum:LoadAnimation(Animation)
    animTrack:Play()
end)
deep meadow
#

Hi! We are using our own animations

prime jungle
deep meadow
#

Hi! I should mention that we've resolved this problem already :D, thank you for your input

prime jungle
#

just so i know to ask when i help ppl in the future

deep meadow
#

We simply placed the code to play the animation under starterplayer

#

unfortunately for the nitty gritty, you're gonna need to talk to our lead programmer

rose cargo