Error: Attempt To Index Nil With 'Humanoid'

I was making a script and it gave the an error: ''Attempt To Index Nil With ‘Humanoid’"

Script:

players.PlayerAdded:Connect(function(plr)
	local char = plr.Character
	local hum = char.Humanoid
	
	if module.CanJump == false then
		hum.JumpPower = 0
	end

	if module.CanWalk == false then
		hum.WalkSpeed = 0
	end
end)
3 Likes

So I believe that should work just test it and just check back if it does not.

1 Like

I just found the solution, you’ll have to put plr.CharacterAdded:connect(function(char) it works

1 Like