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

My StarterPack tools are breaking after death. What is happening? How can I fix it?

Asked by 5 years ago
Edited 5 years ago

I inserted a couple of custom guns I made into the StarterPack, then tested. It worked fine, but when I reseted, the guns broke.

The animations still exist within the tool, but the script keeps saying: (animationName) is not a valid member of Tool

I'm so confused. How can I fix this? How can I prevent this from happening?

Here is the portion of the script, defining the animations:

1local Equip = character:WaitForChild('Humanoid'):LoadAnimation(script.Parent.Equip)
2local Idle = character:WaitForChild('Humanoid'):LoadAnimation(script.Parent.Idle)
3local Reload = character:WaitForChild('Humanoid'):LoadAnimation(script.Parent.Reload)
4local Fire = character:WaitForChild('Humanoid'):LoadAnimation(script.Parent.Fire)

Here's the other portion of the script, playing the animations: (yes, its long.)

001local UIS = game:GetService("UserInputService")
002 
003local camera = workspace.CurrentCamera
004 
005local PlayerGui = game.Players.LocalPlayer.PlayerGui
006 
007local AmmoGui = PlayerGui:WaitForChild("CHX2Gui")
008local currentAmmo = AmmoGui.CurrentAmmo
009local maxAmmo = AmmoGui.MaxAmmo
010 
011local mouse = game.Players.LocalPlayer:GetMouse()
012 
013local backgroundFrame = AmmoGui.BackgroundFrame
014local realFrame = AmmoGui.BackgroundFrame.RealFrame
015 
View all 142 lines...

Sorry if the second script is long. This is all in a LocalScript inside of the tool.

0
Please post the script where the animation is referenced. compUcomp 417 — 5y
0
Okay. Sensei_Developer 298 — 5y

Answer this question