Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Animation will not play?

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!

2 comments

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

0

It doesn't work in any

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.