Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Animation will not play?

Asked by
wackem 50
9 years ago

My problem is that everything works, except the animation simply won't play, the healing works, all of it. Besides playing the animation.

local ipService = game:GetService("UserInputService")

local plr
local char
local hum
local heal

game.Players.PlayerAdded:connect(function(p)
    plr = p
    p.CharacterAdded:wait()
    char = p.Character
    hum = char:WaitForChild("Humanoid")
    local anim = Instance.new("Animation", char)
    anim.Name = "Heal"
    anim.AnimationId = "http://www.roblox.com/asset/?id=262886542"

    heal = hum:LoadAnimation(char:WaitForChild("Heal"))
end)

ipService.InputBegan:connect(function(key,gameProcessedEvent)
    if not gameProcessedEvent and key.KeyCode == Enum.KeyCode.H then
        heal:Play()
        if hum.Health <= 50 then
            hum.Health = hum.Health + 50
        elseif hum.Health > 50 then
            hum.Health = hum.MaxHealth + hum.Health
        end
    end
end)
  • Thanks for your help!
0
Does your animation work in solo mode but not in normal play mode, by any chance? If it Works in solo mode, but not in normal mode, I may know the problem Bubbles5610 217 — 9y
0
It doesn't work in any wackem 50 — 9y

1 answer

Log in to vote
0
Answered by 9 years ago

Hmm, try looking in the WIKI animations section, lemme give you a link.

Ad

Answer this question