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

I get this error when I die while having a sniper tool in my backpack?

Asked by 4 years ago

Whenever I die when I have my sniper and then respawn, this error comes and breaks the sniper?

17:12:59.522 - LoadAnimation requires the Humanoid object (super1boom.Humanoid) to be a descendant of the game object

Here's the code:

local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
wait(0.3)
local human = char.Humanoid
local hold = script.Parent.Hold
local shoot = script.Parent.Shoot
local animate1
local animate2
local RS = game:GetService("ReplicatedStorage")
local event = RS:WaitForChild("Shoot")

tool.Equipped:Connect(function()
    animate1 = human:LoadAnimation(hold)
    animate1:Play()
end)

tool.Unequipped:Connect(function()
    animate1:Stop()
end)

tool.Activated:Connect(function()
    event:FireServer()
    animate2 = human:LoadAnimation(shoot)
    animate2:Play()
end)

The Sniper does work, until I die, which breaks the script for some reason.

0
Why does this have over 600 views? Dovydas1118 1495 — 4y
0
idk raid6n 2196 — 4y
0
lmao super1boom 0 — 4y

Answer this question