So basically when I reset or get killed with a weapon equipped then it just breaks. No animations or guis.This is the FE kit made by Thienbao2109. Presented below.
Output
Script
So basically when I reset or get killed with a weapon equipped then it just breaks. No animations or guis.This is the FE kit made by Thienbao2109. Presented below.
Output
Script
You could try out:
Local Character = Player.Character or Player.CharacterAdded:Wait()
Did you mean to replace that with the humanoid variable? On the output it says line 10 if you are mistaken
I mean you’d replace the character variable with that line instead, getting the player from the GetPlayers service
Oh sorry, alright. Let me try it out before I speak next time.
For some reason It does work, but one tool bugs out and give me a error code of " Players.infervalx.Backpack.Deagle.GunScript_Local:67: attempt to index nil with ‘WaitForChild’ - Client - GunScript_Local:67
19:42:19.699 Stack Begin - Studio
19:42:19.700 Script ‘Players.infervalx.Backpack.Deagle.GunScript_Local’, Line 67 - Studio - GunScript_Local:67
19:42:19.700 Stack End - Studio "
And it’s referring to
if Humanoid.RigType == Enum.HumanoidRigType.R6 then
LeftShoulder = Torso:WaitForChild("Left Shoulder")
RightShoulder = Torso:WaitForChild("Right Shoulder")
OriginalLeftC0 = LeftShoulder.C0
OriginalRightC0 = RightShoulder.C0
else
Waist = Torso:WaitForChild("Waist")
OriginalWaistC0 = Waist.C0
end
The important part of the error message is the attempt to index nil with ‘WaitForChild’. It means that Torso is nil and probably failed to be set to the proper value sometime before the line was run.
Is there a post about fixing that? I don’t program often so I don’t know how to fix it on my own.
It depends on how you’re trying to get the value in the first place. You should look for places in the code where you assign the Torso variable a value.
Something like:
Torso = ...
local Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("UpperTorso")
That’s the variable.
Change it to Character:WaitForChild(…) so it waits for the child to be created.
It replies with a Infinite Yield error.
Hmh, I’d probably have to look at more of the code to figure it out but I have to go for tonight. The thing I’ll leave you with is that the character is there but the script has problems fetching the torso part. You could double-check that it actually comes up in the workspace.
Alright. I’ll come back to this post tomorrow too.
Probably due to the fact it’s getting the older humanoid, maybe you can detect when if the player has died but I’m unsure where you placed the script if its in anything thats related to tools, or a player’s character then I don’t know.