So normally, I play my game inside of studio and everything works fine. But if I die somehow, the next thing I know, none of my animations work. I think for some reason the humanoid gets destroyed, but I’ve put wait functions and other stuff. Here is the syntax error:
11:31:37.092 LoadAnimation requires the Humanoid object (goony83.Humanoid) to be a descendant of the game object - Client - Running:10
I think it is more with the game than a certain script to be honest. I will give you an example anyway tho
(This is part of the script, not all of it) Also I want to mention that it works completely fine until I die
local hum = char:WaitForChild("Humanoid")
local value = game:GetService("ReplicatedStorage").Values.Running
local jeep = workspace.CabinRetreat.Jeep1
local jeep2 = workspace.CabinRetreat.Jeep
local anim = hum:LoadAnimation(anims)
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
elseif input.KeyCode == Enum.KeyCode.LeftShift then
if value.Value == true then
hum.WalkSpeed = 30
if not hum.Sit then
anim:Play()
end
end
end
end)
Is the script parented to a service like ReplicatedFirst or StarterPlayerScripts? The script is trying to load the animation on the previous humanoid (now destroyed).
If it isn’t, then you could try to make a function to make the event forcefully get the humanoid:
local function getHumanoid()
return char:FindFirstChildOfClass("Humanoid")
end
This would return nil if the humanoid doesn’t exist.
Try this script so that it check if the humanoid is here or its still alive:
local hum = char:WaitForChild("Humanoid")
local value = game:GetService("ReplicatedStorage").Values.Running
local jeep = workspace.CabinRetreat.Jeep1
local jeep2 = workspace.CabinRetreat.Jeep
local anim = hum:LoadAnimation(anims)
UIS.InputBegan:Connect(function(input,isTyping)
if isTyping then
return
end
if input.KeyCode == Enum.KeyCode.LeftShift then
if hum ~= nil or hum.Health > 0 then
if value.Value == true then
hum.WalkSpeed = 30
if not hum.Sit then
anim:Play()
end
end
end
end)
Also I would suggest don’t use the hum ~= nil try using if char:FindFirstChildWhichIsA("Humanoid") then end
You could try to print the children of char using:
print(char:GetChildren())
to see all of it’s children and if the humanoid exists. Or try to see if there’s any scripts that interact with the humanoid. Mainly just normal debugging from this point
Hello! Did you try putting the script in StarterPlayer > StarterCharacterScripts? This will run the script every time the character is loaded. You’ll still get the error unless you use a pcall function but it will still run like it’s supposed to.
THANK YOU SO MUCH! This worked completely well and there are now no errors whatsoever! I appreciate it a lot, my game has kind of a deadline and I needed to fix this error ASAP