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

What is wrong with my sword script?

In this sword script I made, I added an animation, but when I press f9 to activate the dev console, it says

Infinite yield possible on 'Workspace:WaitForChild("Humanoid")'

any way to fix this?

--//Variables
local tool = script.Parent.Parent
local handle = tool:WaitForChild("Handle")
local blade = tool:WaitForChild("Blade")
local config = tool:WaitForChild("Configuration")
local dmg = config:WaitForChild("Damage")
local cooldown = config:WaitForChild("CoolDown")
local ani = tool:WaitForChild("Animation")

tool.Equipped:connect(function(mouse)
	local Humanoid = tool.Parent:WaitForChild("Humanoid")
	local animation = Instance.new("Animation")
	animation.AnimationId = "http://www.roblox.com/Asset?ID=970463218"
	tool.Activated:connect(function()
		blade.Damage.Disabled = false
		local animTrack = Humanoid:LoadAnimation(animation)
		animTrack:Play()
		wait(cooldown.Value)
		blade.Damage.Disabled = true
	end)
end)	

1 answer

✓ Accepted answer

You can't really "implement it" easily into the gear. You have to script in an animation into the gear.

Animations and implementing them are very easy.

http://wiki.roblox.com/index.php?title=Animations

Use this link to get started.

If you still have trouble, update your question with the code for the animation and the gear, and i'll help you combine then

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