Barrage animation wont load Bug: Players.e4r54yt64rtq26.PlayerGui.Standless:16: attempt to index nil with ‘FindFirstChild’
02:07:31.675 - Script ‘Players.e4r54yt64rtq26.PlayerGui.Standless’, Line 16
Code:
local P = game:GetService("Players")
local LP = P.LocalPlayer
local C = LP.Character
local U = game:GetService("UserInputService")
local Enabled = false
local Enabled2 = false
local punched = false
local grabanimation = Instance.new("Animation")
grabanimation.AnimationId = "rbxassetid://5499604466"
local barrageanimation = Instance.new("Animation")
barrageanimation.AnimationId = "rbxassetid://5482283696"
local heavypunchanimation = Instance.new("Animation")
heavypunchanimation.AnimationId = "rbxassetid://5482320085"
local uppercutanimation = Instance.new("Animation")
uppercutanimation.AnimationId = "rbxassetid://5487745515"
local BA1 = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid"):LoadAnimation(barrageanimation)
local HP1 = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid"):LoadAnimation(heavypunchanimation)
local UA1 = game.Players.LocalPlayer.Character:FindFirstChild("Humanoid"):LoadAnimation(uppercutanimation)
U.InputBegan:Connect(function(input,gameProccessed)
if gameProccessed == false then
if punched == false then
if input.KeyCode == Enum.KeyCode.R then
HP1:Play()
game.ReplicatedStorage.HeavyPunch:FireServer()
end
if input.KeyCode == Enum.KeyCode.F then
UA1:Play()
game.ReplicatedStorage.Uppercut:FireServer()
end
if input.KeyCode == Enum.KeyCode.E then
BA1:Play()
game.ReplicatedStorage.Barrage:FireServer()
end
if input.KeyCode == Enum.KeyCode.T then
Enabled2 = not Enabled2
if Enabled2 == true then
local BodyGyro = Instance.new("BodyGyro",C.HumanoidRootPart)
while Enabled2 == true do
wait(0.1)
BodyGyro.MaxTorque = Vector3.new(0,math.huge,0)
BodyGyro.D = 1
BodyGyro.P = 99999
BodyGyro.CFrame = C.HumanoidRootPart.CFrame
BodyGyro.CFrame = BodyGyro.CFrame * CFrame.Angles(0,math.rad(30),0)
end
end
if Enabled2 == false then
C.HumanoidRootPart.BodyGyro:Destroy()
end
end
if input.KeyCode == Enum.KeyCode.Comma then
if Enabled == true then
Enabled = false
game.ReplicatedStorage.Respawn:FireServer(C.HumanoidRootPart.CFrame)
end
if Enabled == false then
Enabled = true
game.ReplicatedStorage.Ragdoll:FireServer()
end
end
end
end
end)
game:GetService("UserInputService").InputEnded:Connect(function(input,gameProccessed)
if gameProccessed == false then
if input.KeyCode == Enum.KeyCode.E then
BA1:Stop()
end
end
end)